Ci cd best practices

From Kevin-Liu-01/Agent-Machines · View interactive version

Ci cd best practices is an AI agent skill from the GitHub repository Kevin-Liu-01/Agent-Machines. Apply Dedalus CI/CD workflow rules for runner placement, Docker build verification, artifact publication, and self-hosted runner orchestration. Use when editing GitHub Actions workflows, Docker build pipelines, deploy jobs, Terraform/ECS/Flux workflows, or self-hosted runner automation.

How to use this skill

Skill file

CI/CD Best Practices

Runner placement

Choose the cheapest runner that matches the job's real bottleneck.

`ubuntu-24.04`

Use for I/O-bound or orchestration-heavy jobs:

`blacksmith-4vcpu-ubuntu-2404`

Use for compute-bound jobs:

self-hosted AWS runners

Use only when GitHub-hosted runners cannot do the job:

If the job is only provisioning or cleaning up the self-hosted runner, run

that control job on ubuntu-24.04. Only the payload belongs on self-hosted.

Docker artifact policy

PR CI

Every deployable image must be built in CI with push: false.

Rules:

access; still keep push: false

merge / branch CD

After merge, CD may build and publish the application image for the merged

commit.

Current repo rule:

If you later refactor a service toward true build-once/deploy-later, keep the

same invariant: no unreviewed artifact is written to ECR.

Workflow structure

Prefer these shapes:

  1. verify-build in CI
  2. publish in CD
  3. deploy/apply in CD

Split build from deploy when runner classes differ. A pure Terraform/ECS apply

job should not stay on Blacksmith just because the build job in the same

workflow needs it.

Use reusable workflows for generic behavior. Use service-specific wrapper

workflows when a service needs custom setup such as:

Self-hosted runner guidance

Prefer server-side runner registration when the platform supports it.

For GitHub Actions runners:

runner identity directly

Validation

After editing workflows:

  1. Run actionlint
  2. Check that cheap jobs use ubuntu-24.04
  3. Check that builds/tests remain on Blacksmith or self-hosted
  4. Confirm PR image verification uses push: false
  5. Confirm CD still publishes only from merged branches or explicit deploy

triggers

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.