diff --git a/.github/workflows/azure-prod-build-deploy.yml b/.github/workflows/azure-prod-build-deploy.yml index 7e5e27bea7..9a09b5f185 100644 --- a/.github/workflows/azure-prod-build-deploy.yml +++ b/.github/workflows/azure-prod-build-deploy.yml @@ -5,9 +5,6 @@ name: Azure Production - Build and Deploy # **Who does it impact**: All contributors. on: - push: - branches: - - main workflow_dispatch: permissions: diff --git a/.github/workflows/purge-fastly.yml b/.github/workflows/purge-fastly.yml index b0415c6c44..aa02af6bf3 100644 --- a/.github/workflows/purge-fastly.yml +++ b/.github/workflows/purge-fastly.yml @@ -5,6 +5,7 @@ name: Purge Fastly # **Who does it impact**: Writers and engineers. on: + deployment_status: workflow_dispatch: inputs: nuke_all: @@ -16,9 +17,6 @@ on: description: "Comma separated languages. E.g. 'en,ja, es' (defaults to all)" required: false default: '' - push: - branches: - - main permissions: contents: read @@ -29,11 +27,12 @@ env: jobs: send-purges: + # Run when workflow_dispatch is the event (manual) or when deployment_status is the event (automatic) and it's a successful production deploy if: >- ${{ github.repository == 'github/docs-internal' && - (github.event_name != 'workflow_run' || - github.event.workflow_run.conclusion == 'success') + (github.event_name != 'deployment_status' || + github.event.deployment_status.state == 'success' && github.event.deployment_status.environment == 'production') }} runs-on: ubuntu-latest steps: