Write a GitHub Actions workflow to implement a release train with scheduled promotion across environments

domain: docs.github.com/actions · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Define a workflow triggered by schedule (cron syntax) for automatic promotion windows (e.g., every Tuesday at 10:00 UTC) and by workflow_dispatch for manual promotion.
  2. Use a matrix strategy with a JSON array of environment objects (e.g., [{name: staging, cluster: stg}, {name: production, cluster: prod}]) to fan out deployment steps across environments in a controlled sequence.
  3. Use needs to enforce ordering between matrix jobs so staging must succeed before production is attempted, creating a linear promotion chain within a single workflow run.
  4. Gate production promotion with a GitHub environment protection rule (required reviewers or a deployment timer) on the production environment so the matrix job pauses for approval.
  5. Pass the image tag or artifact version as a workflow input (for workflow_dispatch) or derive it from a previous release job that publishes the version to a workflow output.
  6. Log the promotion results for each environment in the GitHub deployment API (create deployment + deployment status) to maintain an auditable promotion history per environment.

Known gotchas

Related routes

Write a GitHub Actions composite action that runs linting, testing, and SBOM generation as reusable steps and publishes the composite action to a shared internal repository
docs.github.com · 5 steps · unrated
Write a GitHub Actions workflow that uses a reusable workflow with secrets inheritance and outputs to gate a downstream deploy job
docs.github.com · 6 steps · unrated
Implement GitHub Actions build attestations using the attest-build-provenance action and verify the attestation with the GitHub CLI before a downstream deployment job proceeds
GitHub Actions · 6 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans