Skip to content

Commit d364d7c

Browse files
committed
chore: publish rustdoc output to GitHub Pages
1 parent 7a8954f commit d364d7c

File tree

2 files changed

+64
-0
lines changed

2 files changed

+64
-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: docs (dev)
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 --workspace
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-pages-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

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
[![Rust](https://github.com/nginx/ngx-rust/actions/workflows/ci.yaml/badge.svg)](https://github.com/nginx/ngx-rust/actions/workflows/ci.yaml)
2+
[![docs (dev)](https://github.com/bavshin-f5/ngx-rust/actions/workflows/docs.yaml/badge.svg?branch=master)](https://bavshin-f5.github.io/ngx-rust/ngx/index.html)
23
[![crates.io](https://img.shields.io/crates/v/ngx.svg)](https://crates.io/crates/ngx)
34
[![Project Status: Concept – Minimal or no implementation has been done yet, or the repository is only intended to be a limited example, demo, or proof-of-concept.](https://www.repostatus.org/badges/latest/concept.svg)](https://www.repostatus.org/#concept)
45
[![Community Support](https://badgen.net/badge/support/community/cyan?icon=awesome)](https://github.com/nginx/ngx-rust/discussions)

0 commit comments

Comments
 (0)