Skip to content
Latchkey

How to Set a Wait Timer Before a Deploy in GitHub Actions

A wait timer on an environment holds every targeting deploy for a fixed number of minutes before it can proceed.

Enable the Wait timer protection rule on the environment and set the minutes. A job that targets the environment sits in a waiting state for that duration, giving you a window to cancel.

Steps

  • Open the environment in Settings to Environments.
  • Enable Wait timer and set the delay in minutes (up to 43200).
  • Target the environment with environment:; the run waits before deploying.

Workflow

.github/workflows/ci.yml
jobs:
  deploy:
    runs-on: ubuntu-latest
    environment: production
    steps:
      - run: ./deploy.sh

Gotchas

  • The timer is a property of the environment, so it applies to every workflow that targets it.
  • Cancelling the run during the wait stops the deploy without starting it.

Related guides

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