File tree Expand file tree Collapse file tree 1 file changed +38
-32
lines changed
Expand file tree Collapse file tree 1 file changed +38
-32
lines changed Original file line number Diff line number Diff line change 1- name : Build TypeScript Project
1+ name : Deploy to GitHub Pages
22
33on :
44 push :
5- branches :
6- - main
7- pull_request :
8- branches :
9- - main
5+ branches : [ main ]
106 workflow_dispatch :
117
8+ permissions :
9+ contents : read
10+ pages : write
11+ id-token : write
12+
13+ concurrency :
14+ group : " pages"
15+ cancel-in-progress : false
16+
1217jobs :
1318 build :
1419 runs-on : ubuntu-latest
15-
1620 steps :
17- - name : Checkout Repository
21+ - name : Checkout
1822 uses : actions/checkout@v3
19-
20- - name : Setup Node.js
23+
24+ - name : Setup Node
2125 uses : actions/setup-node@v3
2226 with :
23- node-version : 18
27+ node-version : ' 18 '
2428 cache : ' npm'
25-
26- - name : Install Dependencies
27- run : npm install
28-
29- - name : Build Project
29+
30+ - name : Install dependencies
31+ run : npm ci
32+
33+ - name : Build
3034 run : npm run build
31-
32- - name : Start Application on Port 9000
33- run : |
34- npm start &
35- sleep 5
36- curl -I http://localhost:9000 || echo "Server did not start!"
37-
38- - name : Move Images to /assets/img/
39- run : |
40- mkdir -p dist/assets/img
41- mv dist/img/* dist/assets/img/ || echo "No images found, skipping move."
42-
43- - name : Archive Build Artifacts
44- uses : actions/upload-artifact@v4
35+
36+ - name : Setup Pages
37+ uses : actions/configure-pages@v3
38+
39+ - name : Upload artifact
40+ uses : actions/upload-pages-artifact@v2
4541 with :
46- name : BlockHub_b12v.zip
47- path : dist/
42+ path : ' ./dist'
43+
44+ deploy :
45+ environment :
46+ name : github-pages
47+ url : ${{ steps.deployment.outputs.page_url }}
48+ runs-on : ubuntu-latest
49+ needs : build
50+ steps :
51+ - name : Deploy to GitHub Pages
52+ id : deployment
53+ uses : actions/deploy-pages@v2
You can’t perform that action at this time.
0 commit comments