Skip to content

Commit c679218

Browse files
committed
ci: basic site deploy
1 parent b67633e commit c679218

File tree

1 file changed

+58
-0
lines changed

1 file changed

+58
-0
lines changed

.github/workflows/docs.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Deploy to Pages
2+
3+
on:
4+
push:
5+
branches: ['main']
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
concurrency:
14+
group: 'pages'
15+
cancel-in-progress: false
16+
17+
env:
18+
BUILD_PATH: '.'
19+
20+
jobs:
21+
build:
22+
name: Build
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v4
27+
- name: Setup Node
28+
uses: actions/setup-node@v4
29+
with:
30+
node-version: '20'
31+
cache: pnpm
32+
cache-dependency-path: pnpm-lock.yaml
33+
- name: Setup Pages
34+
id: pages
35+
uses: actions/configure-pages@v5
36+
- name: Install dependencies
37+
run: pnpm i --frozen-lockfile
38+
working-directory: ${{ env.BUILD_PATH }}
39+
- name: Build
40+
run: |
41+
pnpm docs:build --base-url "${{ steps.pages.outputs.base_path }}"
42+
working-directory: ${{ env.BUILD_PATH }}
43+
- name: Upload artifact
44+
uses: actions/upload-pages-artifact@v3
45+
with:
46+
path: ${{ env.BUILD_PATH }}/docs/dist
47+
48+
deploy:
49+
environment:
50+
name: github-pages
51+
url: ${{ steps.deployment.outputs.page_url }}
52+
needs: build
53+
runs-on: ubuntu-latest
54+
name: Deploy
55+
steps:
56+
- name: Deploy to GitHub Pages
57+
id: deployment
58+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)