Use the native github way of starting a workflow if checks have succeeded

This commit is contained in:
Charlotte 🦝 Delenk 2022-04-15 19:50:50 +01:00
parent fcf119d20b
commit 2f12e11213
Signed by: darkkirb
GPG key ID: AB2BD8DAF2E37122

View file

@ -1,29 +1,18 @@
name: Deploy to staging
on:
push:
branches:
- main
status
jobs:
deploy:
name: Deploy to staging
runs-on: ubuntu-latest
timeout-minutes: 5 # Try for 5 minutes, then give up
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
uses: actions/checkout@v2
if: github.event.state == 'success'
- name: Push
uses: ad-m/github-push-action@master
if: steps.waitforstatuschecks.outputs.status == 'success'
if: github.event.state == 'success'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: staging