Skip to content

Commit 3a5f99a

Browse files
committed
Add github deploy workflow
1 parent 8ae8de8 commit 3a5f99a

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

.github/workflows/deploy.yml

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

0 commit comments

Comments
 (0)