@@ -3,44 +3,56 @@ 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+ defaults :
23+ run :
24+ working-directory : web-app
25+
26+ environment :
27+ name : github-pages
28+ url : ${{ steps.deployment.outputs.page_url }}
29+
1030 runs-on : ubuntu-latest
31+
1132 steps :
1233 - name : Checkout
1334 uses : actions/checkout@v4
14- - name : Setup Pages
15- id : pages
16- uses : actions/configure-pages@v3
17- - uses : actions/setup-node@v4
35+ - name : Get Node version
36+ run : echo "NODE_VERSION=$(cat .nvmrc)" >> $GITHUB_OUTPUT
37+ id : node-version
38+ - name : Set up Node
39+ uses : actions/setup-node@v4
1840 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
41+ cache-dependency-path : web-app/package-lock.json
42+ node-version : ${{ steps.node-version.outputs.NODE_VERSION }}
43+ cache : ' npm'
44+ - name : Install dependencies
45+ run : npm ci
46+ - name : Generate SVG icons sprite
47+ run : npx tsx generate-svg-icons-sprite.ts
48+ - name : Build
49+ run : npm run build
50+ - name : Setup Pages
51+ uses : actions/configure-pages@v5
2652 - name : Upload artifact
2753 uses : actions/upload-pages-artifact@v3
2854 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 :
55+ path : ' build/client'
4456 - name : Deploy to GitHub Pages
4557 id : deployment
4658 uses : actions/deploy-pages@v4
0 commit comments