2023-04-18 13:35:40 +02:00
|
|
|
---
|
|
|
|
name: "Github Pages - Branch"
|
|
|
|
"on":
|
|
|
|
workflow_call:
|
|
|
|
inputs:
|
|
|
|
# the target tag for generating things
|
|
|
|
tag:
|
|
|
|
required: true
|
|
|
|
type: string
|
|
|
|
# the parent workflow for caching
|
|
|
|
parent_id:
|
|
|
|
required: true
|
|
|
|
type: string
|
2023-05-06 10:20:47 +02:00
|
|
|
env:
|
|
|
|
SCCACHE_GHA_ENABLED: "true"
|
|
|
|
RUSTC_WRAPPER: "sccache"
|
2023-06-28 02:34:17 +02:00
|
|
|
ACTIONS_RUNNER_DEBUG: true
|
2023-04-18 13:35:40 +02:00
|
|
|
jobs:
|
|
|
|
generate_mdbook:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
continue-on-error: true
|
|
|
|
steps:
|
2023-09-06 02:25:30 +02:00
|
|
|
- uses: actions/checkout@v4
|
2023-04-18 13:35:40 +02:00
|
|
|
with:
|
|
|
|
ref: ${{ inputs.tag }}
|
2023-05-06 10:20:47 +02:00
|
|
|
- name: Setup sccache
|
2024-12-15 22:50:01 +01:00
|
|
|
uses: mozilla-actions/sccache-action@v0.0.7
|
2023-04-18 13:35:40 +02:00
|
|
|
with:
|
2023-05-06 10:20:47 +02:00
|
|
|
version: "v0.4.2"
|
2023-04-18 13:35:40 +02:00
|
|
|
- name: Install deps
|
|
|
|
run: |
|
|
|
|
sudo apt-get update
|
2023-09-12 01:54:54 +02:00
|
|
|
sudo apt-get install -y \
|
|
|
|
clang \
|
|
|
|
build-essential \
|
|
|
|
librust-openssl-dev \
|
|
|
|
libssl-dev \
|
|
|
|
libudev-dev \
|
2023-04-18 13:35:40 +02:00
|
|
|
libpam0g-dev
|
|
|
|
- name: Setup mdBook
|
2024-04-15 00:25:44 +02:00
|
|
|
uses: peaceiris/actions-mdbook@v2
|
2023-04-18 13:35:40 +02:00
|
|
|
with:
|
|
|
|
mdbook-version: "latest"
|
|
|
|
|
2023-04-25 14:36:17 +02:00
|
|
|
- name: Install Rust
|
|
|
|
uses: dtolnay/rust-toolchain@stable
|
2023-04-18 13:35:40 +02:00
|
|
|
|
|
|
|
- name: Install python 3.10
|
2023-12-11 02:18:26 +01:00
|
|
|
uses: actions/setup-python@v5
|
2023-04-18 13:35:40 +02:00
|
|
|
with:
|
|
|
|
python-version: "3.10"
|
|
|
|
|
|
|
|
- name: Build the docs
|
2024-09-19 02:56:58 +02:00
|
|
|
# pinning mdbook-alerts because of <https://github.com/lambdalisue/rs-mdbook-alerts/issues/79>
|
2023-04-18 13:35:40 +02:00
|
|
|
run: |
|
2024-09-19 02:56:58 +02:00
|
|
|
cargo install mdbook-alerts --version 0.6.4
|
|
|
|
cargo install mdbook-mermaid
|
2023-04-18 13:35:40 +02:00
|
|
|
cargo doc --no-deps
|
|
|
|
mdbook build *book
|
|
|
|
rm -rf ./docs/
|
2023-05-06 15:38:53 +02:00
|
|
|
mkdir -p ./docs/
|
|
|
|
mv ./*book/book ./docs/${{ inputs.tag }}
|
2023-04-18 13:35:40 +02:00
|
|
|
mkdir -p ./docs/${{ inputs.tag }}/rustdoc/
|
2023-05-07 12:52:13 +02:00
|
|
|
find ./target/doc/ -name .lock -exec rm "{}" \;
|
|
|
|
mv ./target/doc/* ./docs/${{ inputs.tag }}/rustdoc/
|
2023-04-18 13:35:40 +02:00
|
|
|
- name: pykanidm docs
|
|
|
|
run: |
|
|
|
|
python -m pip install poetry
|
|
|
|
cd pykanidm
|
|
|
|
poetry install
|
|
|
|
poetry run mkdocs build
|
|
|
|
cd ..
|
|
|
|
mv pykanidm/site ./docs/${{ inputs.tag }}/pykanidm
|
|
|
|
continue-on-error: true
|
|
|
|
- name: archive things
|
|
|
|
run: |
|
|
|
|
tar czvf ${{ inputs.tag }}.tar.gz ./docs/
|
|
|
|
|
2023-06-28 02:34:17 +02:00
|
|
|
env:
|
|
|
|
ACTIONS_RUNNER_DEBUG: true
|
2023-04-18 13:35:40 +02:00
|
|
|
- name: Upload artifact
|
|
|
|
# https://github.com/actions/upload-artifact
|
2023-12-18 01:56:02 +01:00
|
|
|
uses: actions/upload-artifact@v4
|
2023-04-18 13:35:40 +02:00
|
|
|
with:
|
2024-02-01 01:16:50 +01:00
|
|
|
name: "individual${{ inputs.tag }}"
|
|
|
|
path: ${{ inputs.tag }}.tar.gz
|
2023-06-28 02:34:17 +02:00
|
|
|
env:
|
|
|
|
ACTIONS_RUNNER_DEBUG: true
|