-
Notifications
You must be signed in to change notification settings - Fork 20
110 lines (92 loc) · 3.17 KB
/
ci-docs.yaml
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
110
# NOTE: This name appears in GitHub's Checks API and in workflow's status badge.
name: ci-docs
# Trigger the workflow when:
on:
# A push occurs to one of the matched branches.
push:
branches:
- main
# Cancel in-progress jobs on same branch.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
rust-docs:
# NOTE: This name appears in GitHub's Checks API.
name: rust-docs
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Rust
run: rustup show
- name: Build docs
run: |
cargo doc \
--no-deps \
--package oasis-core-runtime \
--package oasis-runtime-sdk
cargo doc \
--no-deps \
--all-features \
--package oasis-runtime-sdk-macros \
--package oasis-runtime-sdk-contracts \
--package oasis-contract-sdk \
--package oasis-contract-sdk-types \
--package oasis-contract-sdk-storage \
--package rofl-utils
- name: Deploy rust to api-reference branch
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: target/doc
publish_branch: api-reference
destination_dir: rust
commit_message: Deploy rust API reference ${{ github.event.head_commit.message }}
user_name: github-actions[bot]
user_email: 41898282+github-actions[bot]@users.noreply.github.com
js-docs:
name: js-docs
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node.js LTS
uses: actions/setup-node@v4
with:
node-version: "18.x"
cache: npm
cache-dependency-path: 'client-sdk/ts-web/package-lock.json'
- name: Install dependencies and build
working-directory: client-sdk/ts-web
run: npm ci --foreground-scripts
- name: core
working-directory: client-sdk/ts-web/core
run: npx typedoc
- name: rt
working-directory: client-sdk/ts-web/rt
run: npx typedoc
- name: ext-utils
working-directory: client-sdk/ts-web/ext-utils
run: npx typedoc
- name: signer-ledger
working-directory: client-sdk/ts-web/signer-ledger
run: npx typedoc
- name: Merge docs
working-directory: client-sdk/ts-web
run: |
mkdir docs
mv core/docs/api docs/client
mv rt/docs/api docs/client-rt
mv ext-utils/docs/api docs/client-ext-utils
mv signer-ledger/docs/api docs/client-signer-ledger
- name: Deploy js to api-reference branch
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: client-sdk/ts-web/docs
publish_branch: api-reference
destination_dir: js
commit_message: Deploy js API reference ${{ github.event.head_commit.message }}
user_name: github-actions[bot]
user_email: 41898282+github-actions[bot]@users.noreply.github.com