File tree Expand file tree Collapse file tree 2 files changed +97
-0
lines changed Expand file tree Collapse file tree 2 files changed +97
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Deploy to GitHub Pages
2+
3+ on :
4+ workflow_dispatch :
5+ inputs :
6+ environment :
7+ description : ' Environment to deploy to'
8+ required : true
9+ default : ' staging'
10+ branch :
11+ description : ' Branch to deploy'
12+ required : true
13+ default : ' master'
14+ push :
15+ branches :
16+ - master
17+ # Review gh actions docs if you want to further define triggers, paths, etc
18+ # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on
19+
20+ jobs :
21+ build :
22+ name : Build Docusaurus
23+ runs-on : ubuntu-latest
24+ steps :
25+ - uses : actions/checkout@v4
26+ with :
27+ fetch-depth : 0
28+ - uses : actions/setup-node@v4
29+ with :
30+ node-version : lts/hydrogen
31+ cache : npm
32+
33+ - name : Install dependencies
34+ run : npm ci
35+ - name : Build website
36+ run : npm run build
37+
38+ - name : Upload Build Artifact
39+ uses : actions/upload-pages-artifact@v3
40+ with :
41+ path : build
42+
43+ deploy :
44+ name : Deploy to GitHub Pages
45+ needs : build
46+
47+ # Grant GITHUB_TOKEN the permissions required to make a Pages deployment
48+ permissions :
49+ pages : write # to deploy to Pages
50+ id-token : write # to verify the deployment originates from an appropriate source
51+
52+ # Deploy to the github-pages environment
53+ environment :
54+ name : github-pages
55+ url : ${{ steps.deployment.outputs.page_url }}
56+
57+ runs-on : ubuntu-latest
58+ steps :
59+ - name : Deploy to GitHub Pages
60+ id : deployment
61+ uses : actions/deploy-pages@v4
Original file line number Diff line number Diff line change 1+ name : Test deployment
2+
3+ on :
4+ workflow_dispatch :
5+ inputs :
6+ environment :
7+ description : ' Environment to deploy to'
8+ required : true
9+ default : ' staging'
10+ branch :
11+ description : ' Branch to deploy'
12+ required : true
13+ default : ' master'
14+ pull_request :
15+ branches :
16+ - master
17+ # Review gh actions docs if you want to further define triggers, paths, etc
18+ # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on
19+
20+ jobs :
21+ test-deploy :
22+ name : Test deployment
23+ runs-on : ubuntu-latest
24+ steps :
25+ - uses : actions/checkout@v4
26+ with :
27+ fetch-depth : 0
28+ - uses : actions/setup-node@v4
29+ with :
30+ node-version : lts/hydrogen
31+ cache : npm
32+
33+ - name : Install dependencies
34+ run : npm ci
35+ - name : Test build website
36+ run : npm run build
You can’t perform that action at this time.
0 commit comments