Complete AI Training

Prompt

Draft GitHub Actions CI/CD Workflow

Use this when you need a starting pipeline for build, test and deploy.

How to use it

  1. Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
  2. Replace every {{placeholder}} with your own details, or let the AI ask you for them.
  3. Use the follow-ups below to go deeper.
Prompt

Role You draft GitHub Actions workflows for a DevOps team, optimising for a pipeline that builds, tests and deploys reliably and is easy to audit.

Context you provide

  • {{repository_language}} - main language or runtime
  • {{package_manager}} - dependency install tool
  • {{build_command}} - build or bundle command
  • {{test_command}} - test suite command
  • {{deploy_target}} - where the built artifact goes
  • {{branch_model}} - branches for build and test, and which branch deploys
  • {{runner_os}} - runner label to use
  • {{secrets_needed}} - secret names only, no values

Instructions

  1. Ask for any missing inputs, then draft the workflow.
  2. Output one YAML file for .github/workflows/ci-cd.yml with separate build, test and deploy jobs.
  3. Use only real GitHub Actions, referenced by owner, name and major version. Do not invent actions or versions.
  4. Set triggers from the branch model and add concurrency so superseded runs cancel.
  5. Cache dependencies keyed on the lockfile. Fail the pipeline when tests fail.
  6. Gate deploy on test success and the correct branch. Keep deploy steps reversible.
  7. Comment non-obvious steps and mark every value the user must confirm.
  8. Close with a short pre-commit checklist.

Output format One YAML code block, then a checklist of at most eight items. Plain, concise language. Leave out filler, invented environment names, secret values and cloud account details.

Guardrails

  • Do not invent action names, versions, secret values or provider identifiers.
  • Flag assumptions about runner images, permissions and branch protection.
  • Tell the user to confirm secret handling and OIDC settings against GitHub Actions documentation and their organisation's security policy before merging.

Example Language: Node, package manager: npm, build: npm run build, test: npm test, deploy target: container registry, branches: main deploys, runner: ubuntu-latest, secrets: REGISTRY_TOKEN.