specified nightly version #12
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: | |
workflow_dispatch: | |
workflow_call: | |
push: | |
branches: [ main ] | |
name: π Document API | |
jobs: | |
build: | |
name: π Build | |
if: | | |
!startsWith(github.event.head_commit.message, 'ci:') | |
&& !startsWith(github.event.head_commit.message, 'ci(') | |
&& !startsWith(github.event.head_commit.message, 'style:') | |
&& !startsWith(github.event.head_commit.message, 'style(') | |
runs-on: ubuntu-latest | |
steps: | |
- name: π Checkout Git Repository | |
id: checkout_repository_step | |
uses: actions/checkout@v2 | |
- name: π§° Install Rust Toolchain | |
id: install_toolchain_step | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: nightly | |
override: true | |
components: rust-docs | |
- name: π Set up cargo cache | |
id: setup_cache_step | |
uses: actions/cache@v3 | |
continue-on-error: false | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: ${{ runner.os }}-cargo- | |
- name: π Cargo Doc | |
id: cargo_doc_step | |
uses: actions-rs/cargo@v1 | |
env: | |
RUSTDOCFLAGS: "--enable-index-page -Zunstable-options" | |
with: | |
command: doc | |
args: --all-features --workspace --no-deps --document-private-items | |
- name: β¬ Upload Docs Artifact | |
id: upload_docs_step | |
uses: actions/upload-pages-artifact@v1 | |
with: | |
path: target/doc | |
deploy: | |
name: β Deploy | |
if: | | |
!startsWith(github.event.head_commit.message, 'ci:') | |
&& !startsWith(github.event.head_commit.message, 'ci(') | |
&& !startsWith(github.event.head_commit.message, 'style:') | |
&& !startsWith(github.event.head_commit.message, 'style(') | |
needs: build | |
runs-on: ubuntu-latest | |
permissions: | |
pages: write # to deploy to Pages | |
id-token: write # to verify the deployment originates from an appropriate source | |
concurrency: | |
group: "pages" | |
cancel-in-progress: true | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment_step.outputs.page_url }} | |
steps: | |
- name: β Deploy to GitHub Pages | |
id: deployment_step | |
uses: actions/deploy-pages@v1 | |