Skip to content

Commit c641753

Browse files
committed
chore: publish rustdoc output to GitHub Pages
1 parent ab23c13 commit c641753

File tree

1 file changed

+63
-0
lines changed

1 file changed

+63
-0
lines changed

.github/workflows/docs.yaml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Documentation
2+
3+
on:
4+
push:
5+
branches: [github-pages]
6+
7+
env:
8+
CARGO_TERM_COLOR: always
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: checkout source
15+
uses: actions/checkout@v3
16+
- name: set up cargo cache
17+
uses: actions/cache@v3
18+
continue-on-error: false
19+
with:
20+
path: |
21+
~/.cargo/bin/
22+
~/.cargo/registry/index/
23+
~/.cargo/registry/cache/
24+
~/.cargo/git/db/
25+
target/
26+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
27+
restore-keys: ${{ runner.os }}-cargo-
28+
- name: set up nginx deps cache
29+
uses: actions/cache@v3
30+
continue-on-error: false
31+
with:
32+
path: |
33+
.cache/.gnupg
34+
.cache/nginx
35+
.cache/*.tar.gz
36+
.cache/*.tar.asc
37+
.cache/*.tar.sig
38+
key: ${{ runner.os }}-deps-${{ hashFiles('**/nginx-sys/build.rs') }}
39+
restore-keys: ${{ runner.os }}-deps-
40+
- name: build docs
41+
run: cargo doc --no-deps
42+
- name: create index page
43+
run: echo '<meta http-equiv="refresh" content="1;url=ngx/index.html" />' > target/doc/index.html
44+
- name: upload docs artifact
45+
uses: actions/upload-page-artifact@v3
46+
with:
47+
path: "target/doc"
48+
49+
deploy:
50+
needs: build
51+
52+
environment:
53+
name: github-pages
54+
url: ${{ steps.deployment.outputs.page_url }}
55+
56+
permissions:
57+
pages: write
58+
id-token: write
59+
60+
runs-on: ubuntu-latest
61+
steps:
62+
- id: deployment
63+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)