Update build.yml (#451) #425
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Documentation and Push to Build | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
name: Build and Push | |
steps: | |
- name: git-checkout | |
uses: actions/checkout@v4 | |
with: | |
lfs: true | |
- name: Install dependencies | |
run: | | |
npm install -g [email protected] | |
pnpm install | |
- name: setup-go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: "1.22.5" | |
- name: Update openapi docs | |
run: | | |
# Read the changed files from the previous step | |
go mod init github.com/0xsequence/docs | |
go get github.com/mikefarah/yq/v4@latest | |
go run github.com/mikefarah/yq/v4 -e -i '.security=[{"BearerAuth":[]}]' docs/pages/api/analytics/rpc.gen.yaml | |
go run github.com/mikefarah/yq/v4 -e -i '.security=[{"ApiKeyAuth":[]}]' docs/pages/api/marketplace/rpc.gen.yaml | |
go run github.com/mikefarah/yq/v4 -e -i '.security=[{"ApiKeyAuth":[]}, {"BearerAuth":[]}]' docs/pages/api/metadata/rpc.gen.yaml | |
go run github.com/mikefarah/yq/v4 -e -i '.security=[{"ApiKeyAuth":[]}, {"BearerAuth":[]}]' docs/pages/api/indexer/rpc.gen.yaml | |
go run github.com/mikefarah/yq/v4 -e -i '.security=[{"ApiKeyAuth":[]}]' docs/pages/api/relayer/rpc.gen.yaml | |
go run github.com/mikefarah/yq/v4 -e -i '.security=[{"BearerAuth":[]}]' docs/pages/api/builder/rpc.gen.yaml | |
go run github.com/mikefarah/yq/v4 -e -i '.components.securitySchemes.BearerAuth = {"type": "http", "scheme": "bearer", "bearerFormat": "JWT", "description": "JWT Service Token generated from Sequence Builder"}' docs/pages/api/builder/rpc.gen.yaml | |
go run github.com/mikefarah/yq/v4 -e -i '.components.securitySchemes.BearerAuth = {"type": "http", "scheme": "bearer", "bearerFormat": "JWT", "description": "JWT Service Token generated from Sequence Builder"}' docs/pages/api/analytics/rpc.gen.yaml | |
- name: Build | |
run: pnpm run build | |
- name: Touch .nojeykll | |
run: touch ./docs/dist/.nojekyll | |
- name: Touch CNAME | |
run: echo "docs.sequence.xyz" > ./docs/dist/CNAME | |
- name: Copy 404 | |
run: cp 404.html ./docs/dist/404.html | |
- name: Push | |
uses: s0/git-publish-subdir-action@develop | |
env: | |
REPO: self | |
GIT_CLONE_PROTECTION_ACTIVE: false | |
BRANCH: build | |
FOLDER: ./docs/dist | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
MESSAGE: "Build: ({sha}) {msg}" |