Skip to content

Commit 5a74c44

Browse files
author
BitByBit-B3
committed
chore: update ci/cd
1 parent 2a00162 commit 5a74c44

File tree

1 file changed

+19
-12
lines changed

1 file changed

+19
-12
lines changed

.github/workflows/deploy-docs.yml

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,8 @@ on:
55
branches:
66
- main
77
paths:
8-
- 'docs-site/**'
9-
- '.github/workflows/deploy-docs.yml'
10-
11-
# Allow manual trigger
8+
- "docs-site/**"
9+
- ".github/workflows/deploy-docs.yml"
1210
workflow_dispatch:
1311

1412
permissions:
@@ -30,25 +28,34 @@ jobs:
3028
with:
3129
fetch-depth: 0
3230

31+
- name: Setup PNPM
32+
uses: pnpm/action-setup@v4
33+
with:
34+
version: 9
35+
3336
- name: Setup Node
3437
uses: actions/setup-node@v4
3538
with:
3639
node-version: 20
37-
38-
- uses: pnpm/action-setup@v4
40+
cache: pnpm
3941

4042
- name: Setup Pages
4143
uses: actions/configure-pages@v4
4244

43-
- name: Install dependencies
45+
# Optional: silence ${NODE_AUTH_TOKEN} warnings on PRs
46+
- name: Sanitize .npmrc on PRs
47+
if: ${{ github.event_name == 'pull_request' }}
4448
run: |
45-
cd docs-site
46-
pnpm install
49+
if [ -f .npmrc ]; then
50+
sed -i 's#//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}##g' .npmrc || true
51+
fi
52+
53+
- name: Install dependencies (docs workspace only)
54+
run: pnpm install --frozen-lockfile --filter ./docs-site...
4755

4856
- name: Build with VitePress
49-
run: |
50-
cd docs-site
51-
pnpm build
57+
working-directory: docs-site
58+
run: pnpm build
5259

5360
- name: Upload artifact
5461
uses: actions/upload-pages-artifact@v3

0 commit comments

Comments
 (0)