Skip to content

Cleanup

Cleanup #388

Workflow file for this run

name: Docs
permissions:
contents: read
pages: write
id-token: write
on:
push:
branches: [rewrite]
concurrency:
group: "pages"
cancel-in-progress: false
env:
CARGO_TERM_COLOR: always
RUSTDOCFLAGS: "--cfg docsrs"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@nightly
- name: Setup Rust cache
uses: Swatinem/rust-cache@v2
- name: Generate timestamp HTML snippet
run: |
echo "<div style='position: absolute; bottom: 0; width: 100%; text-align: center; padding: 10px; font-size: 0.8em; color: #888;'>Last built: $(date -u +'%Y-%m-%d %H:%M:%S UTC')</div>" > doc-footer.html
- name: Build workspace documentation
run: cargo doc --workspace --no-deps --exclude "spirv*" --exclude "docgen"
env:
RUSTDOCFLAGS: "${{ env.RUSTDOCFLAGS }} --html-after-content doc-footer.html --html-in-header ${{ github.workspace }}/katex-header.html"
- run: |
echo "<meta http-equiv=refresh content=0;url=`echo $GITHUB_REPOSITORY | cut -d '/' -f 2 | tr '[:upper:]' '[:lower:]'`/index.html>" > target/doc/index.html
touch target/doc/.nojekyll
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: target/doc
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4