Cancel previous runs before triggering build

This commit is contained in:
Max Schmidt 2023-06-27 00:06:19 +02:00
parent 389dee988f
commit eded296fd8

View File

@ -3,7 +3,19 @@ on:
repository_dispatch: repository_dispatch:
types: [payload_update] types: [payload_update]
jobs: jobs:
cancel:
name: Cancel Previous Runs
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.11.0
with:
ignore_sha: true
access_token: ${{ github.token }}
workflow_id: "payload.yml"
build: build:
needs: cancel
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Trigger build - name: Trigger build
@ -14,5 +26,4 @@ jobs:
key: ${{ secrets.KEY }} key: ${{ secrets.KEY }}
script: | script: |
cd ${{ secrets.PATH }} cd ${{ secrets.PATH }}
git pull
yarn prod astro yarn prod astro