File tree Expand file tree Collapse file tree 4 files changed +78
-4
lines changed Expand file tree Collapse file tree 4 files changed +78
-4
lines changed Original file line number Diff line number Diff line change 1+ name : Deploy Website to GitHub Pages
2+
3+ on :
4+ push :
5+ branches :
6+ - master # 當推送到 master 分支時觸發
7+ paths :
8+ - " website/**" # 只有當 website 目錄有變更時才觸發
9+ workflow_dispatch : # 允許手動觸發
10+
11+ # 設定 GITHUB_TOKEN 的權限
12+ permissions :
13+ contents : read
14+ pages : write
15+ id-token : write
16+
17+ # 確保同時只有一個部署任務在執行
18+ concurrency :
19+ group : " pages"
20+ cancel-in-progress : false
21+
22+ jobs :
23+ build :
24+ runs-on : ubuntu-latest
25+
26+ steps :
27+ - name : Checkout repository
28+ uses : actions/checkout@v4
29+
30+ - name : Setup Node.js
31+ uses : actions/setup-node@v4
32+ with :
33+ node-version : " 18"
34+ cache : " npm"
35+ cache-dependency-path : " website/package-lock.json"
36+
37+ - name : Install dependencies
38+ run : |
39+ cd website
40+ npm i
41+
42+ - name : Build website
43+ run : |
44+ cd website
45+ npm run build
46+
47+ - name : Setup Pages
48+ uses : actions/configure-pages@v5
49+
50+ - name : Upload artifact
51+ uses : actions/upload-pages-artifact@v3
52+ with :
53+ path : " ./website/dist"
54+
55+ deploy :
56+ environment :
57+ name : github-pages
58+ url : ${{ steps.deployment.outputs.page_url }}
59+ runs-on : ubuntu-latest
60+ needs : build
61+
62+ steps :
63+ - name : Deploy to GitHub Pages
64+ id : deployment
65+ uses : actions/deploy-pages@v4
Original file line number Diff line number Diff line change 11name : CI - master
22
33on :
4- push :
4+ pull_request :
5+ types : [closed]
56 branches :
67 - " master"
78
5455 bump-version :
5556 name : Bump Version and Update GitHub Variable
5657 runs-on : ubuntu-latest
58+ if : github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'build')
5759 outputs :
5860 new_version : ${{ steps.bump.outputs.new_version }}
5961 # needs: unit-test # 等 unit-test 成功才執行
8789 build-image :
8890 name : Build and Push Docker Image
8991 runs-on : ubuntu-latest
92+ if : github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'build')
9093 needs :
9194 # - unit-test # 等 unit-test 成功才執行
9295 - bump-version # 等 bump-version 成功才執行
Original file line number Diff line number Diff line change 1- <!doctype html>
1+ <!DOCTYPE html>
22< html lang ="en ">
33 < head >
44 < meta charset ="UTF-8 " />
5- < link rel ="icon " type ="image/svg+xml " href ="/vite .svg " />
5+ < link rel ="icon " type ="image/svg+xml " href ="./logo .svg " />
66 < meta name ="viewport " content ="width=device-width, initial-scale=1.0 " />
7- < title > Vite + React + TS </ title >
7+ < title > Notion Chart Generator </ title >
88 </ head >
99 < body >
1010 < div id ="root "> </ div >
You can’t perform that action at this time.
0 commit comments