Skip to content
Latchkey

GitHub Actions Workflow for Manual Approval Before Deploy

Gate production deploys behind a human approval.

This workflow builds freely, then a second job targets a protected environment so GitHub pauses for a required reviewer before deploying.

The workflow

.github/workflows/ci.yml
name: Deploy
on:
  push:
    branches: [main]
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: ./build.sh
  deploy:
    needs: build
    runs-on: ubuntu-latest
    environment:
      name: production
      url: https://app.example.com
    steps:
      - uses: actions/checkout@v4
      - run: ./deploy.sh

Notes

  • Create the production environment in repo settings and add required reviewers.
  • The deploy job stays pending until a reviewer approves.
  • No extra action is needed -- the environment protection rule enforces the gate.

Run it cheaper

Point runs-on: at a Latchkey label to run this workflow at roughly 69% lower per-minute cost, with self-healing for transient failures.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →