File tree Expand file tree Collapse file tree 1 file changed +49
-0
lines changed
Expand file tree Collapse file tree 1 file changed +49
-0
lines changed Original file line number Diff line number Diff line change 1+ # This is a basic workflow to help you get started with Actions
2+ name : Node.js CI + Deploy + 2
3+
4+ on :
5+ push :
6+ branches : ["main"]
7+ pull_request :
8+ branches : ["main"]
9+
10+ # Need permissions for GitHub Pages
11+ permissions :
12+ contents : read
13+ pages : write
14+ id-token : write
15+
16+ jobs :
17+ build :
18+ runs-on : ubuntu-latest
19+
20+ strategy :
21+ matrix :
22+ node-version : [20.x]
23+
24+ steps :
25+ - uses : actions/checkout@v4
26+ - name : Use Node.js ${{ matrix.node-version }}
27+ uses : actions/setup-node@v4
28+ with :
29+ node-version : ${{ matrix.node-version }}
30+ cache : ' npm'
31+ - run : npm install
32+ - run : npm run build --if-present
33+
34+ - name : Upload artifact
35+ uses : actions/upload-pages-artifact@v3
36+ with :
37+ path : ' ./dist' # ← change to your build output folder (dist, build, out, etc.)
38+
39+ deploy :
40+ needs : build
41+ runs-on : ubuntu-latest
42+ if : github.ref == 'refs/heads/main' # Only deploy on push to main, not PRs
43+ environment :
44+ name : github-pages
45+ url : ${{ steps.deployment.outputs.page_url }}
46+ steps :
47+ - name : Deploy to GitHub Pages
48+ id : deployment
49+ uses : actions/deploy-pages@v4
You can’t perform that action at this time.
0 commit comments