Merge pull request #1978 from volta-cli/dependabot/cargo/serde_json-1… #589
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
on: | |
push: | |
branches: | |
- main | |
name: API Docs | |
jobs: | |
publish: | |
name: Build and publish | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
- name: Set up cargo | |
uses: actions-rust-lang/setup-rust-toolchain@v1 | |
- name: Cargo Cache | |
uses: Swatinem/rust-cache@v2 | |
- name: Build docs | |
run: | | |
cargo doc --all --features cross-platform-docs --no-deps --document-private-items | |
- name: Prepare docs for publication | |
run: | | |
mkdir -p publish | |
mv target/doc publish/main | |
echo '<!doctype html><a href="volta">volta</a>' > publish/main/index.html | |
echo '<!doctype html><a href="main">main</a>' > publish/index.html | |
- name: Publish docs to GitHub pages | |
uses: JamesIves/github-pages-deploy-action@releases/v3 | |
with: | |
COMMIT_MESSAGE: Publishing GitHub Pages | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
BRANCH: gh-pages | |
FOLDER: publish | |
SINGLE_COMMIT: true |