Skip to content

Commit d4b2343

Browse files
committed
ci: require successful build before deployment
1 parent 687308c commit d4b2343

File tree

1 file changed

+26
-3
lines changed

1 file changed

+26
-3
lines changed

.github/workflows/deploy.yml

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,18 @@ on:
44
push:
55
branches:
66
- master
7+
- develop
8+
pull_request:
9+
branches:
10+
- master
711

812
concurrency:
9-
group: deploy-docs
13+
group: deploy-docs-${{ github.ref }}
1014
cancel-in-progress: true
1115

1216
jobs:
13-
deploy:
14-
name: Deploy to GitHub Pages
17+
build:
18+
name: Build site
1519
runs-on: ubuntu-latest
1620
steps:
1721
- uses: actions/checkout@v4
@@ -31,6 +35,25 @@ jobs:
3135
- name: Build website
3236
run: pnpm run build
3337

38+
- name: Upload build artifact
39+
uses: actions/upload-artifact@v4
40+
with:
41+
name: site-build
42+
path: ./build
43+
retention-days: 1
44+
45+
deploy:
46+
name: Deploy to GitHub Pages
47+
needs: build
48+
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
49+
runs-on: ubuntu-latest
50+
steps:
51+
- name: Download build artifact
52+
uses: actions/download-artifact@v4
53+
with:
54+
name: site-build
55+
path: ./build
56+
3457
- name: Deploy to GitHub Pages
3558
uses: peaceiris/actions-gh-pages@v4
3659
with:

0 commit comments

Comments
 (0)