11name : Deploy static content to Pages
22
33on :
4- # Runs on pushes targeting the default branch
5- push :
6- branches : ['docusaurus']
4+ # Runs on pushes targeting the default branch
5+ push :
6+ branches :
7+ - docusaurus
78
8- # Allows you to run this workflow manually from the Actions tab
9- workflow_dispatch :
9+ # Allows you to run this workflow manually from the Actions tab
10+ workflow_dispatch :
1011
1112# Sets the GITHUB_TOKEN permissions to allow deployment to GitHub Pages
1213permissions :
13- contents : read
14- pages : write
15- id-token : write
14+ contents : read
15+ pages : write
16+ id-token : write
1617
1718# Allow one concurrent deployment
1819concurrency :
19- group : ' pages'
20- cancel-in-progress : true
20+ group : " pages"
21+ cancel-in-progress : true
2122
2223jobs :
23- # Single deploy job since we're just deploying
24- deploy :
25- environment :
26- name : github-pages
27- url : ${{ steps.deployment.outputs.page_url }}
28- runs-on : ubuntu-latest
29- steps :
30- - name : Get the repo (checkout)
31- uses : actions/checkout@v3
32- - name : Set up Node
33- uses : actions/setup-node@v3
34- with :
35- node-version : 18
36- cache : ' npm'
37- - name : Install dependencies
38- run : npm install
39- - name : Build
40- run : npm run build
41- - name : Setup Pages
42- uses : actions/configure-pages@v3
43- - name : Upload artifact
44- uses : actions/upload-pages-artifact@v1
45- with :
46- # Upload dist repository
47- path : ' ./build'
48- - name : Deploy to GitHub Pages
49- id : deployment
50- uses : actions/deploy-pages@v1
24+ build :
25+ name : Build Docusaurus
26+ runs-on : ubuntu-latest
27+ steps :
28+ - uses : actions/checkout@v4
29+ with :
30+ fetch-depth : 0
31+ - uses : actions/setup-node@v4
32+ with :
33+ node-version : 20
34+ cache : npm
35+
36+ - name : Install dependencies
37+ run : npm ci
38+ - name : Build website
39+ run : npm run build
40+
41+ - name : Upload Build Artifact
42+ uses : actions/upload-pages-artifact@v3
43+ with :
44+ path : build
45+
46+ deploy :
47+ name : Deploy to GitHub Pages
48+ needs : build
49+
50+ # Grant GITHUB_TOKEN the permissions required to make a Pages deployment
51+ permissions :
52+ pages : write # to deploy to Pages
53+ id-token : write # to verify the deployment originates from an appropriate source
54+
55+ # Deploy to the github-pages environment
56+ environment :
57+ name : github-pages
58+ url : ${{ steps.deployment.outputs.page_url }}
59+
60+ runs-on : ubuntu-latest
61+ steps :
62+ - name : Deploy to GitHub Pages
63+ id : deployment
64+ uses : actions/deploy-pages@v4
0 commit comments