1- name : Deploy specification
1+ name : Deploy to GitHub Pages
22
33on :
44 push :
55 branches :
66 - 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
79
810env :
9- # this avoids node running out of memory while building
10- NODE_OPTIONS : --max_old_space_size=20480
11-
11+ cwd : ${{github.workspace}}/site
1212jobs :
13- deploy-spec :
13+ build :
14+ name : Build Docusaurus
1415 runs-on : ubuntu-latest
1516 steps :
16- - uses : actions/checkout@v2
17- - name : Use Node.js 15
18- uses : actions/setup-node@v1
17+ - uses : actions/checkout@v4
18+ with :
19+ fetch-depth : 0
20+ - uses : actions/setup-node@v4
21+ with :
22+ node-version : 20
23+ cache : npm
24+
25+ - name : Install dependencies
26+ run : npm install --frozen-lockfile
27+ - name : Build website
28+ run : npm run build
29+
30+ - name : Upload Build Artifact
31+ uses : actions/upload-pages-artifact@v3
1932 with :
20- node-version : ' 15'
21- - run : npm ci
22- - run : npm run build
23- - name : setup git config
24- run : |
25- git config user.name "GitHub Actions Bot"
26- git config user.email "<>"
27- - name : Deploy assembled spec
28- run : |
29- git checkout -b assembled-spec
30- git add -f openrpc.json
31- git add -f refs-openrpc.json
32- git commit -m "assemble openrpc.json"
33- git push -fu origin assembled-spec
34- deploy-gh-pages :
33+ path : build
34+
35+ deploy :
36+ name : Deploy to GitHub Pages
37+ needs : build
38+
39+ # Grant GITHUB_TOKEN the permissions required to make a Pages deployment
40+ permissions :
41+ pages : write # to deploy to Pages
42+ id-token : write # to verify the deployment originates from an appropriate source
43+
44+ # Deploy to the github-pages environment
45+ environment :
46+ name : github-pages
47+ url : ${{ steps.deployment.outputs.page_url }}
48+
3549 runs-on : ubuntu-latest
3650 steps :
37- - uses : actions/checkout@v2
38- - name : Use Node.js 15
39- uses : actions/setup-node@v1
40- with :
41- node-version : ' 15'
42- - run : npm ci
43- - run : npm run build
44- - run : npm run generate-clients
45- - run : ' sed -i -e "s|Prefix: \"\"|Prefix: \"/execution-apis\"|g" build/docs/gatsby/gatsby-config.js'
46- - run : ' sed -i -e "s|/api|api|g" build/docs/gatsby/src/pages/index.tsx'
47- - run : npm run build:docs
48- - name : setup git config
49- run : |
50- git config user.name "GitHub Actions Bot"
51- git config user.email "<>"
5251 - name : Deploy to GitHub Pages
53- if : success()
54- uses : crazy-max/ghaction-github-pages@v3
55- with :
56- target_branch : gh-pages
57- build_dir : build/docs/gatsby/public
58- env :
59- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
52+ id : deployment
53+ uses : actions/deploy-pages@v4
0 commit comments