File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- name : Deploy to GitHub Pages
1+ name : GitHub Pages
22
33on :
44 push :
55 branches : [ main ]
6- workflow_dispatch :
6+ pull_request :
7+ branches : [ main ]
8+
9+ # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
10+ permissions :
11+ contents : read
12+ pages : write
13+ id-token : write
14+
15+ # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
16+ # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
17+ concurrency :
18+ group : " pages"
19+ cancel-in-progress : false
720
821jobs :
9- deploy :
22+ # Build job
23+ build :
1024 runs-on : ubuntu-latest
11- permissions :
12- contents : write
1325 steps :
1426 - name : Checkout
1527 uses : actions/checkout@v4
16- with :
17- fetch-depth : 0
18-
28+
1929 - name : Setup Node.js
2030 uses : actions/setup-node@v4
2131 with :
3747 working-directory : ./website
3848 run : npm run build
3949
40- - name : Deploy to GitHub Pages
41- uses : peaceiris/actions-gh-pages@v3
50+ - name : Setup Pages
51+ uses : actions/configure-pages@v4
52+
53+ - name : Upload artifact
54+ uses : actions/upload-pages-artifact@v3
4255 with :
43- github_token : ${{ secrets.GITHUB_TOKEN }}
44- publish_dir : ./website/dist
45- cname : modernx.js.org
56+ # Upload only the built website
57+ path : ' ./website/dist'
58+
59+ # Deployment job
60+ deploy :
61+ environment :
62+ name : github-pages
63+ url : ${{ steps.deployment.outputs.page_url }}
64+ runs-on : ubuntu-latest
65+ needs : build
66+ if : github.ref == 'refs/heads/main'
67+ steps :
68+ - name : Deploy to GitHub Pages
69+ id : deployment
70+ uses : actions/deploy-pages@v4
You can’t perform that action at this time.
0 commit comments