Skip to content

Commit 61d5b4c

Browse files
committed
chore: github action
1 parent 165a559 commit 61d5b4c

1 file changed

Lines changed: 71 additions & 0 deletions

File tree

.github/workflows/deploy-docs.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: Deploy VitePress Documentation
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- 'docs/**'
9+
- 'packages/react-tools-lib/src/**'
10+
11+
workflow_dispatch:
12+
13+
permissions:
14+
contents: read
15+
pages: write
16+
id-token: write
17+
18+
concurrency:
19+
group: pages
20+
cancel-in-progress: false
21+
22+
jobs:
23+
build:
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@v4
28+
with:
29+
fetch-depth: 0
30+
31+
- name: Setup pnpm
32+
uses: pnpm/action-setup@v3
33+
with:
34+
version: 10
35+
36+
- name: Setup Node
37+
uses: actions/setup-node@v4
38+
with:
39+
node-version: 20
40+
cache: pnpm
41+
42+
- name: Install dependencies
43+
run: pnpm install --frozen-lockfile
44+
45+
- name: Build library
46+
run: pnpm --filter @ndriadev/react-tools build
47+
48+
- name: Build documentation
49+
run: pnpm run build:docs
50+
env:
51+
NODE_ENV: production
52+
53+
- name: Setup Pages
54+
uses: actions/configure-pages@v4
55+
56+
- name: Upload artifact
57+
uses: actions/upload-pages-artifact@v3
58+
with:
59+
path: dist-docs
60+
61+
deploy:
62+
environment:
63+
name: github-pages
64+
url: ${{ steps.deployment.outputs.page_url }}
65+
needs: build
66+
runs-on: ubuntu-latest
67+
name: Deploy
68+
steps:
69+
- name: Deploy to GitHub Pages
70+
id: deployment
71+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)