File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- name : Deploy
1+ name : Deploy to GitHub Pages
22
33on :
44 push :
5- branches :
6- - main
5+ branches : ['main']
6+ workflow_dispatch :
7+
8+ # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
9+ permissions :
10+ contents : read
11+ pages : write
12+ id-token : write
13+
14+ # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
15+ # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
16+ concurrency :
17+ group : ' pages'
18+ cancel-in-progress : false
719
820jobs :
921 build :
10- name : Build
1122 runs-on : ubuntu-latest
12-
1323 steps :
14- - name : Checkout repo
15- uses : actions/checkout@v3
16-
24+ - name : Checkout
25+ uses : actions/checkout@v4
26+
1727 - name : Setup Node
18- uses : actions/setup-node@v3
19-
28+ uses : actions/setup-node@v4
29+ with :
30+ node-version : ' 20'
31+ cache : ' npm'
32+
2033 - name : Install dependencies
21- uses : bahmutov/ npm-install@v1
22-
23- - name : Build project
34+ run : npm ci
35+
36+ - name : Build
2437 run : npm run build
25-
26- - name : Upload production-ready build files
27- uses : actions/upload-artifact@v4
38+
39+ - name : Setup Pages
40+ uses : actions/configure-pages@v4
41+
42+ - name : Upload artifact
43+ uses : actions/upload-pages-artifact@v3
2844 with :
29- name : production-files
30- path : ./dist
45+ path : ' ./dist'
3146
3247 deploy :
33- name : Deploy
34- needs : build
48+ environment :
49+ name : github-pages
50+ url : ${{ steps.deployment.outputs.page_url }}
3551 runs-on : ubuntu-latest
36- if : github.ref == 'refs/heads/main'
37-
52+ needs : build
3853 steps :
39- - name : Download artifact
40- uses : actions/download-artifact@v4
41- with :
42- name : production-files
43- path : ./dist
44-
4554 - name : Deploy to GitHub Pages
46- uses : peaceiris/actions-gh-pages@v3
47- with :
48- github_token : ${{ secrets.GITHUB_TOKEN }}
49- publish_dir : ./dist
55+ id : deployment
56+ uses : actions/deploy-pages@v4
You can’t perform that action at this time.
0 commit comments