Skip to content

Commit f05f727

Browse files
committed
fix: improve workflow in GitHub Actions
1 parent 056387b commit f05f727

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

.github/workflows/docs-deploy.yml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,35 @@
1-
name: Deploy Documentation
1+
name: Build and Deploy Docs
22

33
on:
44
push:
5-
branches:
6-
- main # or whichever branch you want to trigger on
5+
branches: [main] # deploy docs only when pushing to main
6+
workflow_dispatch: # allow manual trigger
77

88
jobs:
9-
build-and-deploy:
9+
docs:
1010
runs-on: ubuntu-latest
1111

1212
steps:
13-
- uses: actions/checkout@v4
14-
with:
15-
submodules: recursive
13+
- name: Checkout repository
14+
uses: actions/checkout@v4
1615

17-
- name: Setup Node.js & pnpm
16+
- name: Setup Node.js
1817
uses: actions/setup-node@v4
1918
with:
2019
node-version: 18
21-
cache: "pnpm"
20+
cache: pnpm
2221

23-
- name: Install dependencies
24-
run: |
25-
corepack enable
26-
pnpm install
22+
- name: Setup pnpm
23+
uses: pnpm/action-setup@v2
24+
with:
25+
version: 9
26+
run_install: true
2727

2828
- name: Build docs
29-
run: pnpm build
29+
run: pnpm run build
3030

3131
- name: Deploy to GitHub Pages
32-
uses: peaceiris/actions-gh-pages@v4
32+
uses: peaceiris/actions-gh-pages@v3
3333
with:
3434
github_token: ${{ secrets.GITHUB_TOKEN }}
35-
publish_dir: build/
35+
publish_dir: ./build

0 commit comments

Comments
 (0)