11name : Deploy to GitHub Pages
22
33on :
4- # Runs on pushes targeting the default branch
54 push :
6- branches : ["master", "main"]
7- # Allows you to run this workflow manually from the Actions tab
8- workflow_dispatch :
9-
10- # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
11- permissions :
12- contents : read
13- pages : write
14- id-token : write
15-
16- concurrency :
17- group : " pages"
18- cancel-in-progress : false
5+ branches :
6+ - main
7+ # Review gh actions docs if you want to further define triggers, paths, etc
8+ # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on
199
2010jobs :
21- deploy :
22- name : Deploy to GitHub Pages
11+ build :
12+ name : Build Docusaurus
2313 runs-on : ubuntu-latest
2414 steps :
2515 - uses : actions/checkout@v4
@@ -28,21 +18,34 @@ jobs:
2818 - uses : actions/setup-node@v4
2919 with :
3020 node-version : 18
31- cache : npm
21+ cache : yarn
3222
3323 - name : Install dependencies
34- run : npm ci
24+ run : yarn install --frozen-lockfile
3525 - name : Build website
36- run : npm run build
26+ run : yarn build
3727
38- - name : Upload artifact
39- uses : actions/upload-pages-artifact@v2
28+ - name : Upload Build Artifact
29+ uses : actions/upload-pages-artifact@v3
4030 with :
41- path : ./build
42- name : github-pages
31+ path : build
4332
44- - name : Deploy
45- uses : actions/deploy-pages@v2
46- with :
47- artifact_name : github-pages
33+ deploy :
34+ name : Deploy to GitHub Pages
35+ needs : build
36+
37+ # Grant GITHUB_TOKEN the permissions required to make a Pages deployment
38+ permissions :
39+ pages : write # to deploy to Pages
40+ id-token : write # to verify the deployment originates from an appropriate source
41+
42+ # Deploy to the github-pages environment
43+ environment :
44+ name : github-pages
45+ url : ${{ steps.deployment.outputs.page_url }}
46+
47+ runs-on : ubuntu-latest
48+ steps :
49+ - name : Deploy to GitHub Pages
4850 id : deployment
51+ uses : actions/deploy-pages@v4
0 commit comments