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
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
generate_mdbook:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
continue-on-error: true
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
ref: ${{ inputs.tag }}
|
|
|
|
- name: Restore our cache
|
|
|
|
uses: actions/cache@v3
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.cargo/bin/
|
|
|
|
~/.cargo/registry/index/
|
|
|
|
~/.cargo/registry/cache/
|
|
|
|
~/.cargo/git/db/
|
|
|
|
target/
|
|
|
|
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
|
|
|
- name: Install deps
|
|
|
|
run: |
|
|
|
|
sudo apt-get update
|
|
|
|
sudo apt-get install -y clang build-essential \
|
|
|
|
librust-openssl-dev libssl-dev \
|
|
|
|
libsqlite3-dev libudev-dev \
|
|
|
|
libpam0g-dev
|
|
|
|
|
|
|
|
- name: Setup mdBook
|
|
|
|
uses: peaceiris/actions-mdbook@v1
|
|
|
|
with:
|
|
|
|
mdbook-version: "latest"
|
|
|
|
|
|
|
|
- uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: stable
|
|
|
|
|
|
|
|
- name: Install python 3.10
|
|
|
|
uses: actions/setup-python@v4
|
|
|
|
with:
|
|
|
|
python-version: "3.10"
|
|
|
|
|
|
|
|
- name: Build the docs
|
|
|
|
run: |
|
|
|
|
cargo doc --no-deps
|
|
|
|
mdbook build *book
|
|
|
|
rm -rf ./docs/
|
|
|
|
mkdir -p ./docs/${{ inputs.tag }}/rustdoc/
|
|
|
|
mv ./*book/book/ ./docs/${{ inputs.tag }}
|
|
|
|
mv ./target/doc/* ./docs/${{ inputs.tag }}/rustdoc/
|
|
|
|
|
|
|
|
- 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/
|
|
|
|
|
|
|
|
- name: Upload artifact
|
|
|
|
# https://github.com/actions/upload-artifact
|
2023-04-23 22:57:46 +02:00
|
|
|
uses: actions/upload-artifact@v3
|
2023-04-18 13:35:40 +02:00
|
|
|
with:
|
|
|
|
name: docs
|
|
|
|
path: ${{inputs.tag }}.tar.gz
|