Skip to content

Commit c183852

Browse files
committed
ci: add docs page deployment workflow
Lifted from the equivalent config in the rustls repo, and customized for rustls-ffi.
1 parent 6af6ad8 commit c183852

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed

.github/workflows/docs.yaml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: documentation
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
workflow_dispatch:
8+
push:
9+
branches:
10+
- main
11+
schedule:
12+
- cron: '0 18 * * *'
13+
14+
jobs:
15+
generate:
16+
name: Generate API documentation
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Checkout sources
20+
uses: actions/checkout@v4
21+
with:
22+
persist-credentials: false
23+
24+
- name: Install rust toolchain
25+
uses: dtolnay/rust-toolchain@nightly
26+
27+
- name: Install zola
28+
uses: taiki-e/install-action@v2
29+
with:
30+
tool: [email protected] # Matched to rustls repo
31+
32+
- name: Generate API JSON data
33+
run:
34+
cargo run --bin docgen > website/static/api.json
35+
36+
- name: Generate site pages
37+
run: |
38+
cd website && zola build --output-dir ../target/website/
39+
40+
- name: Package and upload artifact
41+
uses: actions/upload-pages-artifact@v3
42+
with:
43+
path: ./target/website/
44+
45+
deploy:
46+
name: Deploy
47+
runs-on: ubuntu-latest
48+
if: github.repository == 'rustls/rustls-ffi'
49+
needs: generate
50+
permissions:
51+
pages: write
52+
id-token: write
53+
environment:
54+
name: github-pages
55+
url: ${{ steps.deployment.outputs.page_url }}
56+
steps:
57+
- name: Deploy to GitHub Pages
58+
id: deployment
59+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)