Use the native github way of starting a workflow if checks have succeeded
This commit is contained in:
parent
fcf119d20b
commit
2f12e11213
1 changed files with 3 additions and 14 deletions
17
.github/workflows/deploy.yml
vendored
17
.github/workflows/deploy.yml
vendored
|
@ -1,29 +1,18 @@
|
||||||
name: Deploy to staging
|
name: Deploy to staging
|
||||||
on:
|
on:
|
||||||
push:
|
status
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy:
|
deploy:
|
||||||
name: Deploy to staging
|
name: Deploy to staging
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
timeout-minutes: 5 # Try for 5 minutes, then give up
|
|
||||||
steps:
|
steps:
|
||||||
- name: 'Wait for status checks'
|
|
||||||
uses: DarkKirb/github-action-wait-for-status@master
|
|
||||||
id: waitforstatuschecks
|
|
||||||
with:
|
|
||||||
ignoreActions: Deploy to staging
|
|
||||||
checkInterval: 10
|
|
||||||
waitForCheck: yes
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
|
|
||||||
- name: git-checkout
|
- name: git-checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
if: github.event.state == 'success'
|
||||||
- name: Push
|
- name: Push
|
||||||
uses: ad-m/github-push-action@master
|
uses: ad-m/github-push-action@master
|
||||||
if: steps.waitforstatuschecks.outputs.status == 'success'
|
if: github.event.state == 'success'
|
||||||
with:
|
with:
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
branch: staging
|
branch: staging
|
||||||
|
|
Loading…
Reference in a new issue