-
Notifications
You must be signed in to change notification settings - Fork 41
66 lines (57 loc) · 1.71 KB
/
docs.yaml
File metadata and controls
66 lines (57 loc) · 1.71 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
name: documentation
permissions:
contents: read
on:
workflow_dispatch:
push:
branches: ['main', 'rel-*', 'ci/*']
pull_request:
merge_group:
schedule:
- cron: '0 18 * * *'
jobs:
generate:
name: Generate API documentation
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v6
with:
persist-credentials: false
- name: Install rust toolchain
uses: dtolnay/rust-toolchain@nightly
- name: Install zola
uses: taiki-e/install-action@v2
with:
tool: zola@0.19.1 # Matched to rustls repo
- name: Verify API docs JSON data
run: |
if ! diff website/static/api.json <(cargo run -p rustls-ffi-tools --bin docgen 2>/dev/null); then
echo
echo "ERROR: Generated api.json differs from checked-in version"
echo "Run 'cargo run -p rustls-ffi-tools --bin docgen > website/static/api.json' and commit the changes"
exit 1
fi
- name: Generate site pages
run: |
cd website && zola build --output-dir ../target/website/
- name: Package and upload artifact
uses: actions/upload-pages-artifact@v3
if: github.ref == 'refs/heads/main'
with:
path: ./target/website/
deploy:
name: Deploy
runs-on: ubuntu-latest
if: github.repository == 'rustls/rustls-ffi' && github.ref == 'refs/heads/main'
needs: generate
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4