-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
50 lines (48 loc) · 1.65 KB
/
doc.yml
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
on:
push:
branches:
- master
- '0.[0-9]+.x'
- '1.[0-9]+.x'
- '2.[0-9]+.x'
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@v4
- 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 "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
- uses: dtolnay/rust-toolchain@nightly
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get -y install libmysqlclient-dev libsqlite3-dev libpq-dev
- name: Build documentation
env:
RUSTFLAGS: "--cfg docsrs"
RUSTDOCFLAGS: "--cfg docsrs"
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