Skip to content

Add Fly.io deploy workflow triggered on release#56

Open
cubny wants to merge 1 commit into
masterfrom
ci/fly-deploy
Open

Add Fly.io deploy workflow triggered on release#56
cubny wants to merge 1 commit into
masterfrom
ci/fly-deploy

Conversation

@cubny

@cubny cubny commented Jul 10, 2026

Copy link
Copy Markdown
Owner

Problem

Tagging v3.3.1 did not deploy anything to fly.io, and no new image appeared in the registry.

Root cause: there is no fly.io deploy automation in this repo, and there never has been.

  • release.yml runs goreleaser only — it cross-compiles binaries and attaches zips to the GitHub Release. It never builds a Docker image and never contacts fly.io.
  • fly.toml (added in 6835a08, "Fly.io Launch config files") makes fly deploy work from a laptop, but no CI step ever calls it.
  • flyctl releases shows 5 releases, all created manually by cubny@duck.com, the most recent on May 20 2026. Production has been serving that image ever since.
  • grep -ri "flyctl|fly deploy|FLY_API_TOKEN" across the repo returned zero hits.

The application code was never the problem — the scheduler fix landed on master as aedd415, and CI's docker-build job confirms the image builds cleanly.

Fix

Adds .github/workflows/fly-deploy.yml, which runs flyctl deploy --remote-only on release: created — matching the existing release.yml trigger, so tagging a release now both publishes binaries and deploys. workflow_dispatch is included so a deploy can be re-run by hand without cutting a new release.

A concurrency group prevents two deploys from racing.

Setup already done

  • Created a deploy-scoped fly token github-actions-deploy on the lite-reader app, expiring 2027-07-10 (flyctl defaults to a 20-year expiry; 1 year is more appropriate for a CI credential).
  • Stored it as the repo secret FLY_API_TOKEN.

Verifying after merge

This workflow can't run until it's on the default branch. Once merged, trigger it manually to deploy the already-released v3.3.1:

gh workflow run "Deploy to Fly.io" --ref master

Then confirm flyctl status --app lite-reader reports a machine updated today rather than 2026-05-20.

Note: the deploy checks out the ref the workflow ran on. Dispatching against master deploys master's tip; a release: created run deploys the tag.

🤖 Generated with Claude Code

Releases previously ran goreleaser only, which publishes binaries to the
GitHub Release. Nothing built or pushed an image to fly.io, so every
deploy since the app launched was a manual `fly deploy`. Tagging v3.3.1
therefore left production running the May 20 image.

Deploy on `release: created` to match the existing release.yml trigger,
plus workflow_dispatch for manual re-runs. Authenticates with a
deploy-scoped FLY_API_TOKEN stored in repo secrets.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

1 participant