forked from diesel-rs/diesel
-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (50 loc) · 1.86 KB
/
doc.yml
File metadata and controls
53 lines (50 loc) · 1.86 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
on:
push:
branches:
- main
- "0.[0-9]+.x"
- "1.[0-9]+.x"
- "2.[0-9]+.x"
permissions:
contents: "write"
pages: "write"
name: Publish Docs
jobs:
publish_docs:
if: github.repository == 'diesel-rs/diesel'
name: Publish Docs
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v5
- name: Cache cargo registry
uses: Swatinem/rust-cache@v2
with:
key: cargo-doc-cargo-${{ hashFiles('**/Cargo.toml') }}
- name: Get the branch name
id: current_branch
shell: bash
run: |
echo "branch=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_OUTPUT
- uses: dtolnay/rust-toolchain@nightly
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get -y install libmysqlclient-dev libsqlite3-dev libpq-dev libtirpc-dev
- name: Build documentation
env:
RUSTFLAGS: "--cfg diesel_docsrs"
RUSTDOCFLAGS: "--cfg diesel_docsrs -Z unstable-options --generate-link-to-definition --generate-macro-expansion"
run: cargo +nightly doc --manifest-path diesel/Cargo.toml --features "postgres sqlite mysql extras i-implement-a-third-party-backend-and-opt-into-breaking-changes" --workspace
- name: Publish documentation
if: success()
uses: JamesIves/github-pages-deploy-action@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-pages # The branch the action should deploy to.
folder: target/doc # The folder the action should deploy.
# Store documentation for each branch in a different folder
# This allows us to differentiate between docs for master
# and docs for already released versions
target-folder: ${{ steps.current_branch.outputs.branch }}
single-commit: true