Skip to content

Commit 2bb6515

Browse files
authored
Update build.yml
1 parent bf86046 commit 2bb6515

File tree

1 file changed

+29
-19
lines changed

1 file changed

+29
-19
lines changed

.github/workflows/build.yml

Lines changed: 29 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
name: Build & Test
1+
name: Build & Deploy
2+
23
on:
34
push:
4-
branches-ignore:
5-
- gh-page
65
workflow_dispatch:
76

87
jobs:
@@ -15,32 +14,43 @@ jobs:
1514
steps:
1615
- name: Checkout
1716
uses: actions/checkout@v3
17+
1818
- name: Use Node.js ${{ matrix.node-version }}
1919
uses: actions/setup-node@v3
2020
with:
2121
node-version: ${{ matrix.node-version }}
2222
cache: npm
23-
- run: npm install
24-
- run: npm run build
25-
- run: npm run dev
23+
24+
- name: Install dependencies
25+
run: npm install
26+
27+
- name: Build project
28+
run: npm run build
2629
env:
2730
CI: true
2831

29-
test:
32+
- name: Upload build artifacts
33+
uses: actions/upload-artifact@v3
34+
with:
35+
name: dist
36+
path: dist
37+
38+
deploy:
39+
needs: build
3040
runs-on: ubuntu-latest
31-
strategy:
32-
matrix:
33-
node-version: ['20']
34-
name: Test using Node v${{ matrix.node-version }}
3541
steps:
3642
- name: Checkout
3743
uses: actions/checkout@v3
38-
- name: Use Node.js ${{ matrix.node-version }}
39-
uses: actions/setup-node@v3
44+
45+
- name: Download build artifacts
46+
uses: actions/download-artifact@v3
4047
with:
41-
node-version: ${{ matrix.node-version }}
42-
cache: npm
43-
- run: npm install
44-
- run: npm run build
45-
env:
46-
CI: true
48+
name: dist
49+
path: dist
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: dist
56+
branch: gh-pages

0 commit comments

Comments
 (0)