-
Notifications
You must be signed in to change notification settings - Fork 4
67 lines (53 loc) · 2.54 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
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 '.servers=[{"url":"https://api.sequence.build"}]' docs/pages/api/analytics/analytics.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}"