Skip to content

Commit f54773b

Browse files
committed
Only run deploy on successful pull_request/push
1 parent 5444eb2 commit f54773b

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

.github/workflows/build.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,3 @@ jobs:
4141
with:
4242
name: page-build
4343
path: public/
44-

.github/workflows/deploy-prod.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
jobs:
1010
deploy_live_website:
1111
runs-on: ubuntu-latest
12-
if: github.event_name == 'push'
12+
if: github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'push'
1313
steps:
1414
- name: Download pages
1515
uses: actions/download-artifact@v4
@@ -43,13 +43,15 @@ jobs:
4343

4444
deploy_github_pages:
4545
runs-on: ubuntu-latest
46+
if: github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'pull_request'
4647
steps:
4748
- name: Checkout repository
4849
uses: actions/checkout@v3
4950

50-
- name: Download artifact
51+
- name: Download pages
5152
uses: actions/download-artifact@v4
5253
with:
54+
run-id: ${{ github.event.workflow_run.id }}
5355
name: page-build
5456
path: public
5557

0 commit comments

Comments
 (0)