Skip to content

docs(cloud-build): GitHub Actions guide with combined .env export#704

Merged
riderx merged 5 commits into
mainfrom
feat/github-actions-docs
May 18, 2026
Merged

docs(cloud-build): GitHub Actions guide with combined .env export#704
riderx merged 5 commits into
mainfrom
feat/github-actions-docs

Conversation

@WcaleNieWolny
Copy link
Copy Markdown
Contributor

@WcaleNieWolny WcaleNieWolny commented May 18, 2026

Summary

Adds a dedicated GitHub Actions page under apps/docs/.../cli/cloud-build/ that walks users through the full CI/CD setup using the new combined .env export from build credentials manage (shipped in Cap-go/capgo#2280).

The new flow

  1. gh secret set CAPGO_TOKEN --body "..."
  2. npx @capgo/cli@latest build credentials manage --appId <appId>Export to .env → writes .env.capgo.<appId> containing both platforms' secrets
  3. gh secret set -f .env.capgo.<appId> — one shot, every secret pushed to GitHub

No manual base64 encoding, no JSON wrangling, no copy-pasting one secret at a time.

Page contents

  • Setup steps (4-step <Steps> block with API key, export, secret push, workflow file)
  • Three workflow templates: Manual trigger, Tag-based release (iOS+Android matrix), Debug build on push to main
  • "What ends up in your secrets" reference table
  • Common patterns: skip Play Store / TestFlight upload, capture build output URL, skip build number bump, cache node_modules / Pods / .gradle
  • CI-specific troubleshooting table (incl. shared-key drift)
  • Cross-links to credentials, iOS, Android, configuration pages

Other edits

  • getting-started.mdx — replaces the inline 10-line GitHub Actions snippet under "CI/CD Integration" with a link to the new page (eliminates duplication; resolves a conflict where main updated the snippet to bun)
  • troubleshooting.mdx — sidebar order: 56
  • credentials.mdx — sidebar order: 67

Sidebar after this PR

Order Page
0 Introduction
1 Getting Started
2 Configuration Options
3 iOS Builds
4 Android Builds
5 GitHub Actions (new)
6 Troubleshooting
7 Managing Credentials

Dependency

Documents behaviour shipped by Cap-go/capgo#2280 (merged). Should land after the next @capgo/cli release publishes the combined-export.

Test plan

  • bun run dev:docs renders the new page at /docs/cli/cloud-build/github-actions/
  • All JSX components paired (<CardGrid>, <Steps>, <Aside>, <LinkCard>)
  • All code fences paired (20 fence lines = 10 paired blocks)
  • All internal cross-links target existing pages (/docs/webapp/api-keys/, /docs/cli/cloud-build/credentials/, /docs/cli/cloud-build/configuration/, /docs/cli/cloud-build/ios/, /docs/cli/cloud-build/android/, /docs/cli/cloud-build/troubleshooting/)
  • Reviewer eyeball pass on the rendered page

Summary by CodeRabbit

  • Documentation
    • Added a comprehensive GitHub Actions integration guide with setup, workflow examples, caching guidance, build patterns, and troubleshooting for automated iOS and Android releases
    • Updated getting-started to reference the new GitHub Actions guide for CI/CD examples
    • Adjusted sidebar ordering for troubleshooting and credentials pages to improve navigation placement

Review Change Stack

New page walks users through the full GitHub Actions setup:
  - one `gh secret set CAPGO_TOKEN` for the API key
  - `build credentials manage` → Export to .env → single
    `.env.capgo.<appId>` file containing both platforms' secrets
  - `gh secret set -f .env.capgo.<appId>` to push every CI secret in one shot

Includes three workflow templates (manual dispatch, tag-based release
with iOS+Android matrix, debug build on push to main), shared-key
conflict guidance, and CI-specific troubleshooting.

Replaces the inline GitHub Actions YAML snippet in getting-started.mdx
with a link to the new page so the canonical workflow examples live in
one place.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 18, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f4c35a69-e929-4381-bc08-ce08ecf8de6a

📥 Commits

Reviewing files that changed from the base of the PR and between 640c5ed and 77d66fd.

📒 Files selected for processing (1)
  • apps/docs/src/content/docs/docs/cli/cloud-build/github-actions.mdx

📝 Walkthrough

Walkthrough

Adds a new GitHub Actions guide for Capgo Cloud Build (setup, secrets, three workflow examples, caching, patterns, troubleshooting) and updates cloud-build sidebar ordering and getting-started to reference the new guide.

Changes

GitHub Actions Documentation

Layer / File(s) Summary
GitHub Actions CI/CD integration guide
apps/docs/src/content/docs/docs/cli/cloud-build/github-actions.mdx
New comprehensive documentation page covering frontmatter, prerequisites, credential export/import to GitHub Secrets, repository secret names, three workflow examples (manual, release-on-tag, debug-on-push), build patterns (skip uploads, output recording, build-number control), dependency caching guidance, troubleshooting table, and next-steps links.
Navigation metadata and cross-references
apps/docs/src/content/docs/docs/cli/cloud-build/credentials.mdx, apps/docs/src/content/docs/docs/cli/cloud-build/troubleshooting.mdx, apps/docs/src/content/docs/docs/cli/cloud-build/getting-started.mdx
Updated sidebar.order in credentials (6→7) and troubleshooting (5→6); replaced inline GitHub Actions example in getting-started with a reference to the new GitHub Actions guide.
sequenceDiagram
  participant Dev as Developer
  participant GH as GitHub Actions
  participant CapgoCLI as Capgo CLI
  participant Secrets as GitHub Secrets

  Dev->>CapgoCLI: export credentials -> .env.capgo.<appId>
  Dev->>Secrets: gh secret set -f (.env.capgo.<appId>) -> per-platform secrets
  GH->>Secrets: read CAPGO_TOKEN + per-platform secrets
  GH->>CapgoCLI: run bunx `@capgo/cli` build with env secrets
  CapgoCLI->>GH: return build output (URL/QR) or upload artifacts
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • Cap-go/website#652: Overlaps edits to the Cloud Build docs, notably the getting-started.mdx CI/CD/GitHub Actions section.

Poem

🐰 I hopped through docs with a tick and a tap,
Secrets tucked safe in a GitHub secret map.
Workflows dispatched, releases take flight,
Build URLs glowing like lanterns at night.
Hooray — CI gardens planted just right!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: adding a GitHub Actions guide documentation page with combined .env export functionality, which aligns directly with the primary objective of the PR.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/github-actions-docs

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint skipped: no ESLint configuration detected in root package.json. To enable, add eslint to devDependencies.


Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e8b6c82059

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/docs/src/content/docs/docs/cli/cloud-build/github-actions.mdx Outdated
…pture

Replaces the regex-and-tee scraping pattern with the clean opt-in record
flow shipped in Cap-go/capgo#2290:

  --output-record /tmp/build.json  →  npx @capgo/cli build last-output --field outputUrl

Also adds two troubleshooting rows for empty URLs (build had no
--output-upload or failed early) and schemaVersion mismatches (producer
and reader on different CLI versions).
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/docs/src/content/docs/docs/cli/cloud-build/github-actions.mdx`:
- Line 383: Update the table cell that currently advises "Pin both producer and
reader to the same `@capgo/cli@latest` version" so it recommends using an
explicit, fixed version string instead of `@latest` (e.g. `@capgo/cli@x.y.z`)
for both producer and reader; change the text referencing `@capgo/cli@latest` to
something like "Pin both producer and reader to the same explicit
`@capgo/cli@x.y.z` version" to avoid suggesting a floating tag.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d127d80b-4cef-472b-8c79-21be11125440

📥 Commits

Reviewing files that changed from the base of the PR and between 943c873 and f8e38a8.

📒 Files selected for processing (4)
  • apps/docs/src/content/docs/docs/cli/cloud-build/credentials.mdx
  • apps/docs/src/content/docs/docs/cli/cloud-build/getting-started.mdx
  • apps/docs/src/content/docs/docs/cli/cloud-build/github-actions.mdx
  • apps/docs/src/content/docs/docs/cli/cloud-build/troubleshooting.mdx

Comment thread apps/docs/src/content/docs/docs/cli/cloud-build/github-actions.mdx Outdated
The page's CI examples used `actions/setup-node` + `npm ci` + `npx`,
which (a) violates the website's documented tooling convention
(AGENTS.md: "Always use bun instead of npm. Always use bunx instead of
npx.") and (b) breaks bun-only projects out of the box because `npm ci`
requires a `package-lock.json` that doesn't exist when the lockfile is
`bun.lock`.

Match the rest of cloud-build/*.mdx and the linked `getting-started.mdx`:
  - `actions/setup-node@v4 + cache: 'npm'` → `oven-sh/setup-bun@v2`
  - `npm ci` → `bun install --frozen-lockfile`
  - `npm run build` → `bun run build`
  - `npx cap sync …` → `bunx cap sync …`
  - `npx @capgo/cli@latest …` → `bunx @capgo/cli@latest …`
  - `npm version` → `bun pm version`
  - Cache section: rewritten around `~/.bun/install/cache` + `bun.lock`,
    with an honest note that bun installs are fast enough that the JS
    cache is rarely the bottleneck.

Troubleshooting row updated: "you forgot npm ci before cap sync" → "you
forgot bun install before cap sync".
…latest

The schemaVersion-mismatch troubleshooting cell previously said 'pin
both producer and reader to the same @capgo/cli@latest version', which
contradicts itself — @latest is a floating tag that can change between
the producer job and a later reader job, so pinning to it pins nothing.
Recommend an explicit semver pin (e.g. @capgo/cli@7.104.0) on both
sides instead.
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

♻️ Duplicate comments (1)
apps/docs/src/content/docs/docs/cli/cloud-build/github-actions.mdx (1)

380-380: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

“Pin to @latest” is contradictory; use an explicit CLI version.

@latest is floating, so this guidance does not actually pin producer/reader compatibility for build last-output schema parsing.

Suggested edit
-| `build last-output` errors with `Unsupported record schemaVersion` | The runner is on an older CLI than the one that wrote the record. Pin both producer and reader to the same `@capgo/cli@latest` version |
+| `build last-output` errors with `Unsupported record schemaVersion` | The runner is on an older CLI than the one that wrote the record. Pin both producer and reader to the same explicit `@capgo/cli@x.y.z` version |
Is npm package tag `@latest` a floating dist-tag (not a pinned immutable version), and is `@package@x.y.z` the correct way to pin a CLI version in docs?
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/docs/src/content/docs/docs/cli/cloud-build/github-actions.mdx` at line
380, Update the doc line that recommends pinning both producer and reader to
`@capgo/cli@latest`: clarify that `@latest` is a floating dist-tag and replace
it with guidance to pin to an explicit immutable version (e.g.,
`@capgo/cli@x.y.z`) so `build last-output` schema compatibility is ensured; edit
the text referencing `build last-output` and the `@capgo/cli@latest` token to
show the correct pinning form (`@package@x.y.z`) and an example of using an
explicit version.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/docs/src/content/docs/docs/cli/cloud-build/github-actions.mdx`:
- Line 326: Update the user-facing sentence that references `--qr` so that the
word "Markdown" is capitalized; locate the line containing the backticked `--qr`
example and change "markdown code fence" to "Markdown code fence" to use the
proper noun form.

---

Duplicate comments:
In `@apps/docs/src/content/docs/docs/cli/cloud-build/github-actions.mdx`:
- Line 380: Update the doc line that recommends pinning both producer and reader
to `@capgo/cli@latest`: clarify that `@latest` is a floating dist-tag and
replace it with guidance to pin to an explicit immutable version (e.g.,
`@capgo/cli@x.y.z`) so `build last-output` schema compatibility is ensured; edit
the text referencing `build last-output` and the `@capgo/cli@latest` token to
show the correct pinning form (`@package@x.y.z`) and an example of using an
explicit version.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a7b757aa-e6fc-4f7f-a82a-521a6662705e

📥 Commits

Reviewing files that changed from the base of the PR and between f8e38a8 and 36af8f2.

📒 Files selected for processing (1)
  • apps/docs/src/content/docs/docs/cli/cloud-build/github-actions.mdx

Comment thread apps/docs/src/content/docs/docs/cli/cloud-build/github-actions.mdx Outdated
@sonarqubecloud
Copy link
Copy Markdown

@riderx riderx merged commit 7925370 into main May 18, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants