Skip to content

Commit fec0520

Browse files
committed
mod: update gh action
- use node 16 properly - improve gh page deployment
1 parent 8d90aff commit fec0520

File tree

1 file changed

+26
-25
lines changed

1 file changed

+26
-25
lines changed

.github/workflows/deploy.yml

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,37 @@
1-
name: Deploy Static Site
1+
name: Build and Deploy
22

33
on:
44
push:
55
branches:
66
- main
77

88
jobs:
9-
deploy:
9+
build_and_deploy:
1010
runs-on: ubuntu-latest
1111

1212
steps:
13-
- name: Checkout Repository
14-
uses: actions/checkout@v2
15-
with:
16-
node-version: 16
17-
18-
- name: Install pnpm
19-
run: npm install -g @pnpm/exec
20-
21-
- name: Testing
22-
run: |
23-
pnpm install
24-
pnpm run test
25-
26-
- name: Build and Generate Static Site
27-
run: |
28-
pnpm install
29-
pnpm run prod
30-
31-
- name: Deploy to GitHub Pages
32-
uses: peaceiris/actions-gh-pages@v3
33-
with:
34-
github_token: ${{ secrets.GITHUB_TOKEN }}
35-
publish_dir: ./build # Adjust the directory containing your static site
13+
- uses: actions/checkout@v2
3614

15+
- name: Setup Node.js environment
16+
uses: actions/setup-node@v2
17+
with:
18+
node-version: '16.x'
19+
20+
- name: Install pnpm
21+
run: npm install -g pnpm
22+
23+
- name: Install dependencies
24+
run: pnpm install
25+
26+
- name: Run tests
27+
run: pnpm test
28+
29+
- name: Build
30+
run: pnpm prod
31+
32+
- name: Deploy to GitHub Pages
33+
uses: peaceiris/actions-gh-pages@v4
34+
with:
35+
publish-dir: ./build
36+
publish-branch: gh-pages
37+
deploy_key: ${{ secrets.DEPLOY_KEY }}

0 commit comments

Comments
 (0)