mirror of
https://github.com/lennart-k/rustical.git
synced 2025-12-11 15:52:18 +00:00
52 lines
1.1 KiB
YAML
52 lines
1.1 KiB
YAML
name: docs
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
permissions:
|
|
contents: write
|
|
id-token: write
|
|
pages: write
|
|
jobs:
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-python@v5
|
|
with:
|
|
python-version: 3.x
|
|
|
|
- run: rustup update
|
|
|
|
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
|
|
|
|
- name: Set up build cache
|
|
uses: actions/cache/restore@v4
|
|
with:
|
|
key: mkdocs-material-${{ hashfiles('.cache/**') }}
|
|
path: .cache
|
|
restore-keys: |
|
|
mkdocs-material-
|
|
- run: pip install mkdocs-material
|
|
- run: mkdocs build --clean
|
|
|
|
- name: Save build cache
|
|
uses: actions/cache/save@v4
|
|
with:
|
|
key: mkdocs-material-${{ hashfiles('.cache/**') }}
|
|
path: .cache
|
|
|
|
- name: Build crate docs
|
|
run: |
|
|
cargo doc --no-deps --workspace
|
|
cp -r target/doc/ site/_crate
|
|
|
|
- name: Upload to GitHub Pages
|
|
uses: actions/upload-pages-artifact@v3
|
|
with:
|
|
path: site
|
|
|
|
- name: Deploy to GitHub Pages
|
|
uses: actions/deploy-pages@v4
|