ci-cd-game
GitHub Actions pipeline rules for a Bun game backend on Neon and Fly.io: migrations before deploy, one Neon database branch per pull request, a smoke test…
by fcsouza★ 29 GitHub stars
Install ci-cd-game in Claude Code & Claude Desktop
Sign up to install this skill
Create a free account to reveal the install command and save the skill to your library.
- Reveal the one-line install command
- Save skills to your synced library
- Get notified when skills update
About this skill
CI/CD for Games
General GitHub Actions syntax comes from the vendor: use the github-actions-templates skill if it is installed, otherwise https://docs.github.com/en/actions. This skill covers the parts a game backend adds.
Rules
- Migrate before deploy. A separate
migratejob runsbunx drizzle-kit migrate;deploydeclaresneeds: migrate. If migrations fail, GitHub skips the deploy and the old server keeps running. - Migrations must work with the previous server image. A Fly rollback redeploys an old image and leaves the database as it is. Add columns and tables in one release; drop or rename them in a later release, once no running image reads them. Roll back with
fly releases --app <app> --imageto find the previous image, thenfly deploy --image <that image>. - One deploy at a time.
deploy.ymlsets aconcurrencygroup so two quick merges never migrate production together. A newer pending run replaces an older pending one; a running one finishes.ci.ymlhas one group per pull request (per branch for pushes) withcancel-in-progress: true: a new push cancels the stale run, and closing the pull request cancels a test run still in flight, so it cannot recreate the Neon branch after cleanup deletes it. - One Neon branch per pull request.
ci.ymlcreatespreview/pr-<number>, migrates it and runs the tests against it. The action'sparent_branchinput is set from theNEON_CI_PARENT_BRANCHvariable; without it the branch copies the project's default branch, usually production. Theclosedevent deletes the branch. On later pushes the action returns the existing branch and Drizzle applies only the new migrations. - Never branch CI databases from production. Pull-request code runs migrations and tests on the branch, so a production parent hands it a full copy of player data. Keep a seed branch with synthetic or anonymised data and name it in
NEON_CI_PARENT_BRANCH, or use a separate Neon project for CI.ci.ymlfails before creating the branch when that variable is empty, so a missing variable stops CI instead of copying production. Neon's schema-only branches copy the schema without data, for filling with randomized or anonymized rows; the feature is in beta. - Smoke test the game, not only the server. After deploy, check
/health, then runbun run smoke: open a WebSocket and complete the handshake, then run one matchmaking round trip. A server can answer HTTP and still fail every game session. - Pin Bun. Without
bun-version, setup-bun readspackageManagerorengines.bunfrompackage.jsonand falls back tolatest, which changes with each Bun release. The lockfile format has changed between Bun versions (1.2 moved to the textbun.lock), so pin the version the team runs locally and bump it on purpose. Hashbun.lockin the cache key. - Gate production on people when needed. Add required reviewers to the
productionenvironment. Only themigratejob references it, so one approval releases migrate, deploy and smoke. - Pin third-party actions by commit SHA. The Neon actions receive the Neon API key, and a tag can be moved. The boilerplate pins every action not published by GitHub to a full commit SHA with the release tag as a trailing comment (flyctl has no current release, so its comment names the branch and date); let Dependabot or Renovate bump the pins. GitHub's workflow dependency lockfile (
.github/workflows/actions.lock, made withgh actions-lock) is the stronger option where a repository can adopt it. MakeNEON_API_KEYa project-scoped key, which reaches a single project; creating one needs a Neon organization admin. - Keep one main branch and let tests gate every deploy. Rare shipped Sea of Thieves this way: trunk-based development and heavy investment in automated tests.
deploy.ymldoes not wait forci.yml, so protectmainand require thetestcheck before merging.
Pitfalls
- Pull requests from forks. GitHub passes no secrets to them, so the Neon step fails. Run those pull requests from a branch in the repository, or skip the database steps for forks.
- Dependabot pull requests. Workflows started by Dependabot see only Dependabot secrets, not Actions secrets. Store
NEON_API_KEY,DATABASE_URL_TESTandREDIS_URL_TESTas Dependabot secrets too, or every pin bump fails at the Neon step. - Destructive migration in the same release as the code change. The rollback image then reads a column that no longer exists. Split it across two releases (rule 2).
- Health check only.
/healthpasses while WebSocket upgrades or matchmaking fail. Keep the smoke script. - Cache key on a missing file.
hashFilesreturns an empty string when no file matches, so the key stops changing when dependencies change. Hashbun.lock, the file Bun writes.
Files
boilerplate/ci.yml: copy when setting up CI. Lint, type check and tests on every push tomainand every pull request; ea
Allowed tools
Tools this skill is permitted to call.
No restriction — this skill can use any tool.
Bundled files
- boilerplate/ci.yml
- boilerplate/deploy.yml
- references/sources.md
FAQ
What does the ci-cd-game skill do?
GitHub Actions pipeline rules for a Bun game backend on Neon and Fly.io: migrations before deploy, one Neon database branch per pull request, a smoke test after deploy, and a pinned Bun version. Use when a game project needs CI, a deploy workflow, preview databases for pull requests, or a safe order for schema migrations and server deploys.
How do I install the ci-cd-game skill?
Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.
Does the ci-cd-game skill run scripts?
No, this skill is instructions only (SKILL.md) with no executable scripts.
Related skills
mcp-builder
AnthropicGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
claude-api
AnthropicReference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
algorithmic-art
AnthropicCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
mcp-integration
AnthropicThis skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…