Skip to content

Commit

Permalink
Try using concurrency to cancel instead
Browse files Browse the repository at this point in the history
  • Loading branch information
ColeDCrawford committed Jul 17, 2024
1 parent 939ad86 commit e72ba48
Showing 1 changed file with 4 additions and 18 deletions.
22 changes: 4 additions & 18 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
repository_dispatch:
types: [build-trigger]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -24,24 +28,6 @@ jobs:
npm install --legacy-peer-deps
npm run build
- name: Cancel Previous Deployments
id: cancel_previous_deployments
uses: actions/github-script@v6
with:
script: |
const deployments = await github.repos.listDeployments({
owner: context.repo.owner,
repo: context.repo.repo
});
const inProgressDeployments = deployments.data.filter(deployment => deployment.status === 'in_progress');
for (const deployment of inProgressDeployments) {
await github.repos.deleteDeployment({
owner: context.repo.owner,
repo: context.repo.repo,
deployment_id: deployment.id
});
}
- name: Deploy
uses: peaceiris/actions-gh-pages@v4
with:
Expand Down

0 comments on commit e72ba48

Please sign in to comment.