-
Notifications
You must be signed in to change notification settings - Fork 119
109 lines (104 loc) · 3.77 KB
/
Copy pathpublish-docs.yaml
File metadata and controls
109 lines (104 loc) · 3.77 KB
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
name: Build docs and publish to GitHub Pages and Walrus
on:
push:
branches:
- "main"
paths:
- "docs/**"
- ".github/workflows/publish-docs.yaml"
workflow_dispatch:
inputs:
publish-pages:
description: "Publish to GitHub Pages"
type: boolean
required: true
default: false
update-walrus-site:
description: "Update the Walrus Site"
type: boolean
required: true
default: false
schedule:
# Update Walrus Site every first day of the month at 03:14 UTC.
- cron: "14 3 1 * *"
concurrency: ci-${{ github.ref }}
permissions:
contents: read
jobs:
publish-github-pages:
name: Publish to GitHub Pages
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' || inputs.publish-pages == true }}
permissions:
contents: write
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # pin@v6.0.2
- name: Install pnpm
uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # pin@v5.0.0
with:
version: 9
- name: Setup Node.js
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # pin@v6.3.0
with:
node-version: '20'
cache: 'pnpm'
cache-dependency-path: docs/site/pnpm-lock.yaml
- name: Install dependencies
run: cd docs/site && pnpm install --frozen-lockfile
- name: Build site
run: cd docs/site && pnpm run build
- name: Check route config
run: cd docs/site && ./check-routes.sh
- name: Update GitHub Pages
uses: JamesIves/github-pages-deploy-action@d92aa235d04922e8f08b40ce78cc5442fcfbfa2f # pin@v4.8.0
with:
folder: docs/site/build
clean-exclude: pr-preview/
force: false
# We store the data for the Sui wallet and the site object in GitHub variables
# (https://github.com/MystenLabs/walrus/settings/variables/actions) and secrets
# (https://github.com/MystenLabs/walrus/settings/secrets/actions).
publish-walrus:
name: Update Walrus Site
runs-on: ubuntu-ghcloud
if: ${{ github.event_name == 'push' || github.event_name == 'schedule' || inputs.update-walrus-site == true }}
concurrency:
group: sui-wallet-operations
cancel-in-progress: false
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # pin@v6.0.2
with:
persist-credentials: false
- name: Install pnpm
uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # pin@v5.0.0
with:
version: 9
- name: Setup Node.js
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # pin@v6.3.0
with:
node-version: '20'
cache: 'pnpm'
cache-dependency-path: docs/site/pnpm-lock.yaml
- name: Install dependencies
run: cd docs/site && pnpm install --frozen-lockfile
- name: Build site
run: cd docs/site && pnpm run build
- name: Check route config
run: cd docs/site && ./check-routes.sh
- name: Deploy to Walrus
uses: MystenLabs/walrus-sites-github-actions/deploy@554cf074616fdc211991c2c57d034baea2a13fb8 # v3
with:
SUI_ADDRESS: "${{ vars.SUI_ADDRESS }}"
SUI_KEYSTORE: "${{ secrets.SUI_KEYSTORE }}"
WALRUS_CONFIG: "${{ vars.WALRUS_CONFIG }}"
SUI_NETWORK: mainnet
DIST: docs/site/build
WS_RESOURCES: docs/site/ws-resources.json
EPOCHS: "10"
GAS_BUDGET: "2000000000"
SITE_BUILDER_VERSION: v2
- name: Wait for deployment to propagate
run: sleep 60
- name: Test markdown routes
run: |
cd docs/site && ./ping-test.sh https://docs.wal.app/docs/getting-started.md --retries 12 --delay 20