Skip to content

Commit a9b8d7b

Browse files
committed
add deploy workflow
1 parent 9febe69 commit a9b8d7b

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Deploy docs
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
jobs:
10+
build:
11+
name: Build
12+
runs-on: ubuntu-latest
13+
defaults:
14+
run:
15+
working-directory: ./
16+
17+
steps:
18+
- name: Checkout repo
19+
uses: actions/checkout@v4
20+
21+
- name: Setup Node
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: 20
25+
26+
- name: Install dependencies
27+
run: npm install
28+
29+
- name: Build project
30+
run: npm run build
31+
32+
- name: Upload production-ready build files
33+
uses: actions/upload-artifact@v4
34+
with:
35+
name: production-files
36+
path: ./build
37+
38+
deploy:
39+
name: Deploy
40+
needs: build
41+
runs-on: ubuntu-latest
42+
if: github.ref == 'refs/heads/main'
43+
44+
steps:
45+
- name: Download artifact
46+
uses: actions/download-artifact@v4
47+
with:
48+
name: production-files
49+
path: ./build
50+
51+
- name: Deploy to GitHub Pages
52+
uses: peaceiris/actions-gh-pages@v4
53+
with:
54+
github_token: ${{ secrets.GITHUB_TOKEN }}
55+
publish_dir: ./build

0 commit comments

Comments
 (0)