-
Notifications
You must be signed in to change notification settings - Fork 186
103 lines (97 loc) · 3.25 KB
/
docs.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
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
# Initial version from: https://github.com/actions/starter-workflows/blob/main/pages/mdbook.yml
#
name: Deploy mdBook site to Pages
on:
# Allows using this workflow in other workflows
workflow_call:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
release:
types:
- released
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
# Build job
build:
runs-on: ubuntu-latest
env:
MDBOOK_VERSION: 0.4.31
steps:
- uses: dtolnay/rust-toolchain@7b1c307e0dcbda6122208f10795a713336a9b35a
with:
toolchain: stable
- uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- name: Install sitemap CLI
run: |
npm i -g static-sitemap-cli
- name: Install mdBook
run: |
cargo install --version ${MDBOOK_VERSION} mdbook
- name: Install mdBook Link-Check
run: |
cargo install mdbook-linkcheck
- name: Install Scarb
uses: software-mansion/setup-scarb@v1
with:
scarb-version: nightly
- name: Generate and build snforge_std docs
run: |
scarb doc
pushd target/doc/snforge_std
mdbook build
working-directory: ./snforge_std
- name: Generate and build sncast_std docs
run: |
scarb doc
pushd target/doc/sncast_std
mdbook build
working-directory: ./sncast_std
- name: Setup Pages
id: pages
uses: actions/configure-pages@v5
- name: Build with mdBook
run: mdbook build
working-directory: ./docs
- name: Add snforge_std docs
run: |
mkdir -p ./docs/book/html/snforge_std
cp -r ./snforge_std/target/doc/snforge_std/book/* ./docs/book/html/snforge_std/
- name: Add sncast_std docs
run: |
mkdir -p ./docs/book/html/sncast_std
cp -r ./sncast_std/target/doc/sncast_std/book/* ./docs/book/html/sncast_std/
- name: Apply custom highlighting
run: |
curl -o highlight.js https://raw.githubusercontent.com/software-mansion/scarb/main/extensions/scarb-doc/theme/highlight.js
cp highlight.js ./docs/book/html/sncast_std/highlight.js
cp highlight.js ./docs/book/html/snforge_std/highlight.js
- name: Generate sitemap
run: |
sscli --base https://foundry-rs.github.io/starknet-foundry
working-directory: ./docs/book/html
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./docs/book/html
# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4