Mid run changes #319
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Derived from: https://github.com/dnaka91/advent-of-code/blob/main/.github/workflows/docs.yml | |
name: github-pages-docs | |
on: | |
push: | |
branches: | |
- '**' | |
- '!gh-pages' | |
- '!mutex_gh_pages' | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
doc_deploy: | |
permissions: | |
pages: write | |
id-token: write | |
contents: write | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Update Ubuntu Packages | |
run: sudo apt-get update | |
- uses: awalsh128/cache-apt-pkgs-action@v1 | |
with: | |
packages: llvm \ | |
clang \ | |
libclang-dev \ | |
libopencv-dev | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
components: clippy | |
- uses: Swatinem/rust-cache@v2 | |
- name: Build docs | |
run: cargo doc --features logging,graphing | |
- name: Add redirect | |
run: echo '<meta http-equiv="refresh" content="0;url=sw8s_rust_lib/index.html">' > target/doc/index.html | |
- name: Remove lock file | |
run: rm target/doc/.lock | |
- uses: ben-z/[email protected] | |
with: | |
branch: gh-pages-mutex | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
folder: target/doc | |
target-folder: docs/${{ github.ref_name }} |