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…
от fcsouza★ 29 звёзд на GitHub
Установить ci-cd-game в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
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
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- boilerplate/ci.yml
- boilerplate/deploy.yml
- references/sources.md
FAQ
Что делает скилл 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 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.
Как установить скилл ci-cd-game?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл ci-cd-game запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
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…