Skip to content

Commit 9344fa4

Browse files
committed
ci: Make deploy run only if check is successful
1 parent c65bbc8 commit 9344fa4

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

.github/workflows/check.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: check
1+
name: Check
22

33
on:
44
push:
@@ -58,3 +58,13 @@ jobs:
5858
run: yarn build
5959
env:
6060
CI: true
61+
62+
deploy-call:
63+
needs:
64+
- check
65+
permissions:
66+
pages: write
67+
id-token: write
68+
contents: read
69+
if: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/main' }}
70+
uses: ./.github/workflows/deploy.yml

.github/workflows/deploy.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
name: Deploy
22

33
on:
4-
push:
5-
branches: ["main"]
4+
workflow_call:
65
workflow_dispatch:
76

87
concurrency:
@@ -38,14 +37,15 @@ jobs:
3837
path: ./build
3938

4039
deploy:
40+
needs:
41+
- build
4142
environment:
4243
name: github-pages
4344
url: ${{ steps.deployment.outputs.page_url }}
4445
permissions:
4546
pages: write
4647
id-token: write
4748
runs-on: ubuntu-latest
48-
needs: build
4949
steps:
5050
- name: Deploy to GitHub Pages
5151
id: deployment

0 commit comments

Comments
 (0)