CD: auto-deploy main to fly.io on push #2

Closed
opened 2026-05-23 20:53:54 +00:00 by coilysiren · 0 comments
Owner

Originally filed by @coilysiren on 2026-05-13T14:40:43Z - https://github.com/coilysiren/cli-mcp-go-ecosystem/issues/8

Today fly.io deploys are manual (flyctl deploy from a workstation). Surfaced during testing of #4/#5/#7: even after fixing bugs and pushing to main, the hosted endpoint at https://cli-mcp-go-ecosystem.fly.dev/mcp keeps serving the previous binary until somebody remembers to ssh into a laptop and run flyctl deploy.

The repo already has the build artifacts in place:

  • Dockerfile - reproducible build target
  • fly.toml - app config (sjc, port 8080, auto-stop)

Missing: the GitHub Actions glue. Want a .github/workflows/deploy.yml that on push to main:

  1. Checks out the repo
  2. Sets up flyctl via superfly/flyctl-actions/setup-flyctl@master
  3. Runs flyctl deploy --remote-only against the configured app
  4. Authenticates via FLY_API_TOKEN repo secret

Open questions:

  • Gating: deploy on every push to main, or only when a deploy tag is pushed? Repo norm across coilysiren/* is commit-to-main with no PRs, so deploy-on-main matches. Optional: skip deploy when only *.md / docs/ / .github/ changed (paths-ignore filter).
  • Secret provisioning: FLY_API_TOKEN needs to land in repo secrets. flyctl tokens create deploy -a cli-mcp-go-ecosystem produces a scoped deploy-only token. Store under repo secrets, not org secrets, to keep blast radius tight.
  • Rollback: fly.io retains the previous machine image. Document flyctl releases / flyctl deploy --image <prev> in the deploy.yml comments so future-Kai knows where to look when an autodeployed commit breaks prod.
  • Health: post-deploy curl against /health (if implemented) or /mcp initialize, fail the workflow if the hosted endpoint doesn't respond. Saves "deploy succeeded, app crashed" silence.

Lower-priority adjacent: same pattern would be useful for any future cli-mcp-* consumer that wants a hosted demo, so the workflow is reusable. Maybe a snippet in cli-mcp-go-ecosystem's README's "Local dev" section once #5 is closed.

_Originally filed by @coilysiren on 2026-05-13T14:40:43Z - [https://github.com/coilysiren/cli-mcp-go-ecosystem/issues/8](https://github.com/coilysiren/cli-mcp-go-ecosystem/issues/8)_ Today fly.io deploys are manual (`flyctl deploy` from a workstation). Surfaced during testing of #4/#5/#7: even after fixing bugs and pushing to main, the hosted endpoint at https://cli-mcp-go-ecosystem.fly.dev/mcp keeps serving the previous binary until somebody remembers to ssh into a laptop and run `flyctl deploy`. The repo already has the build artifacts in place: - [`Dockerfile`](Dockerfile) - reproducible build target - [`fly.toml`](fly.toml) - app config (`sjc`, port 8080, auto-stop) Missing: the GitHub Actions glue. Want a `.github/workflows/deploy.yml` that on push to `main`: 1. Checks out the repo 2. Sets up flyctl via [superfly/flyctl-actions/setup-flyctl@master](https://github.com/superfly/flyctl-actions) 3. Runs `flyctl deploy --remote-only` against the configured app 4. Authenticates via `FLY_API_TOKEN` repo secret Open questions: - **Gating**: deploy on every push to main, or only when a `deploy` tag is pushed? Repo norm across `coilysiren/*` is commit-to-main with no PRs, so deploy-on-main matches. Optional: skip deploy when only `*.md` / `docs/` / `.github/` changed (paths-ignore filter). - **Secret provisioning**: `FLY_API_TOKEN` needs to land in repo secrets. `flyctl tokens create deploy -a cli-mcp-go-ecosystem` produces a scoped deploy-only token. Store under repo secrets, not org secrets, to keep blast radius tight. - **Rollback**: fly.io retains the previous machine image. Document `flyctl releases` / `flyctl deploy --image <prev>` in the deploy.yml comments so future-Kai knows where to look when an autodeployed commit breaks prod. - **Health**: post-deploy curl against `/health` (if implemented) or `/mcp` initialize, fail the workflow if the hosted endpoint doesn't respond. Saves "deploy succeeded, app crashed" silence. Lower-priority adjacent: same pattern would be useful for any future cli-mcp-* consumer that wants a hosted demo, so the workflow is reusable. Maybe a snippet in cli-mcp-go-ecosystem's README's "Local dev" section once #5 is closed.
Commenting is not possible because the repository is archived.
No labels
P3
P4
No milestone
No project
No assignees
1 participant
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
coilysiren/cli-mcp-go-ecosystem#2
No description provided.