-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CI: add documentation generation job
- Loading branch information
1 parent
2c81d3e
commit 8a89447
Showing
1 changed file
with
48 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: Documentation | ||
on: | ||
push: | ||
branches: [ main ] | ||
|
||
jobs: | ||
doc: | ||
name: Documentation | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }}/valib | ||
permissions: | ||
id-token: write | ||
pages: write | ||
steps: | ||
- name: Install dependencies | ||
if: startsWith(matrix.os, 'ubuntu') | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y libasound2-dev | ||
- uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/.cargo/registry/index/ | ||
~/.cargo/registry/cache/ | ||
~/.cargo/git/db/ | ||
target/ | ||
key: ${{ matrix.name }}-${{ matrix.cross-target }} | ||
- uses: actions/checkout@v2 | ||
- name: Fetch all git history | ||
run: git fetch --force --prune --tags --unshallow | ||
- name: Set up Rust toolchain | ||
uses: actions-rs/toolchain@v1 | ||
- name: Build documentation | ||
run: cargo doc --all-features --no-deps | ||
- name: Fix permissions | ||
run: | | ||
chmod -c -R +rX "target/doc" | while read line; do | ||
echo "::warning title=Invalid file permissions automatically fixed::$line" | ||
done | ||
- name: Upload Pages artifact | ||
uses: actions/upload-pages-artifact@v3 | ||
with: | ||
path: target/doc | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v4 # or specific "vX.X.X" version tag for this action |