Files
songbird/.github/workflows/docs.yml
Jonathan 841224ee7a chore(workflows): Update checkout action to v3 (#175)
This change was done as the v2 version still used the node v12 runtime.
This runtime is deprecated by github. There are no other breaking
changes done by the action. With the update to v3 now node v16 is used
as runtime.

You can read more about the changes from v2 to v3 here:
https://github.com/actions/checkout/releases/tag/v3.0.0
2023-11-20 00:02:57 +00:00

63 lines
1.5 KiB
YAML

name: Publish docs
on:
push:
branches:
- current
- next
jobs:
docs:
name: Publish docs
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Install toolchain
id: tc
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
profile: minimal
override: true
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libopus-dev
- name: Setup cache
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target/debug
key: ${{ runner.os }}-gh-pages-${{ steps.tc.outputs.rustc_hash }}-${{ hashFiles('**/Cargo.toml') }}
- name: Build docs
env:
RUSTDOCFLAGS: -D broken_intra_doc_links
run: |
cargo doc --no-deps --features full-doc
- name: Prepare docs
shell: bash -e -O extglob {0}
run: |
DIR=${GITHUB_REF/refs\/+(heads|tags)\//}
mkdir -p ./docs/$DIR
touch ./docs/.nojekyll
echo '<meta http-equiv="refresh" content="0;url=songbird/index.html">' > ./docs/$DIR/index.html
mv ./target/doc/* ./docs/$DIR/
- name: Deploy docs
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: gh-pages
publish_dir: ./docs
allow_empty_commit: false
keep_files: true