@@ -3,51 +3,49 @@ name: Deploy to GitHub Pages
33on :
44 push :
55 branches : [ main ]
6+ pull_request :
7+ branches : [ main ]
68
7- permissions :
8- contents : read
9- pages : write
10- id-token : write
11-
9+ # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
10+ # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
1211concurrency :
1312 group : " pages"
1413 cancel-in-progress : false
1514
1615jobs :
17- build-and-deploy :
18- environment :
19- name : github-pages
20- url : ${{ steps.deployment.outputs.page_url }}
16+ build :
2117 runs-on : ubuntu-latest
2218
19+ strategy :
20+ matrix :
21+ node-version : [18.x]
22+
2323 steps :
2424 - name : Checkout
2525 uses : actions/checkout@v4
2626
27- - name : Setup Node.js
27+ - name : Setup Node.js ${{ matrix.node-version }}
2828 uses : actions/setup-node@v4
2929 with :
30- node-version : ' 18 '
30+ node-version : ${{ matrix.node-version }}
3131 cache : ' npm'
3232
3333 - name : Install dependencies
3434 run : npm ci --legacy-peer-deps
3535
36- - name : Build
37- run : npm run build
38-
39- - name : Export static files
40- run : |
41- touch out/.nojekyll
36+ - name : Build project
37+ run : npm run build:production
4238
43- - name : Setup Pages
44- uses : actions/configure-pages@v4
45-
46- - name : Upload artifact
47- uses : actions/upload-pages-artifact@v3
48- with :
49- path : ./out
39+ - name : Add .nojekyll file
40+ run : touch out/.nojekyll
5041
5142 - name : Deploy to GitHub Pages
52- id : deployment
53- uses : actions/deploy-pages@v4
43+ uses : peaceiris/actions-gh-pages@v3
44+ if : github.ref == 'refs/heads/main'
45+ with :
46+ github_token : ${{ secrets.GITHUB_TOKEN }}
47+ publish_dir : ./out
48+ # Enable Jekyll processing to be disabled
49+ enable_jekyll : false
50+ # Add CNAME if using custom domain
51+ # cname: your-domain.com
0 commit comments