@@ -3,44 +3,54 @@ name: Deploy
33on :
44 push :
55 branches : [main]
6+ # Allows you to run this workflow manually from the Actions tab
7+ workflow_dispatch :
8+
9+ # Allow one concurrent deployment
10+ concurrency :
11+ group : ' pages'
12+ cancel-in-progress : true
13+
14+ # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
15+ permissions :
16+ contents : read
17+ pages : write
18+ id-token : write
619
720jobs :
8- # Build job
9- build :
21+ deploy :
22+ environment :
23+ name : github-pages
24+ url : ${{ steps.deployment.outputs.page_url }}
25+
1026 runs-on : ubuntu-latest
27+ defaults :
28+ run :
29+ working-directory : web-app
30+
1131 steps :
1232 - name : Checkout
1333 uses : actions/checkout@v4
14- - name : Setup Pages
15- id : pages
16- uses : actions/configure-pages@v3
17- - uses : actions/setup-node@v4
34+ - name : Get Node version
35+ run : echo "NODE_VERSION=$(cat .nvmrc)" >> $GITHUB_OUTPUT
36+ id : node-version
37+ - name : Set up Node
38+ uses : actions/setup-node@v4
1839 with :
19- node-version : 20.x
20- - run : npm ci
21- working-directory : web-app
22- - run : npx tsx generate-svg-icons-sprite.ts
23- working-directory : web-app
24- - run : npm run build
25- working-directory : web-app
40+ node-version : ${{ steps.node-version.outputs.NODE_VERSION }}
41+ cache : ' npm'
42+ - name : Install dependencies
43+ run : npm ci
44+ - name : Generate SVG icons sprite
45+ run : npx tsx generate-svg-icons-sprite.ts
46+ - name : Build
47+ run : npm run build
48+ - name : Setup Pages
49+ uses : actions/configure-pages@v5
2650 - name : Upload artifact
2751 uses : actions/upload-pages-artifact@v3
2852 with :
29- path : ' web-app/build/client'
30-
31- # Deployment job
32- deploy :
33- # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
34- permissions :
35- contents : read
36- pages : write
37- id-token : write
38- environment :
39- name : github-pages
40- url : https://heiso.github.io/macrolev
41- runs-on : ubuntu-latest
42- needs : build
43- steps :
53+ path : ' build/client'
4454 - name : Deploy to GitHub Pages
4555 id : deployment
4656 uses : actions/deploy-pages@v4
0 commit comments