Change GH Pages CI token var name #6
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
name: Rust CI | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
- name: Install cargo-make | |
run: cargo install cargo-make | |
# Cache the runner details before the build and test steps | |
- name: Cache runner details before build and test | |
uses: actions/cache@v2 | |
with: | |
path: ~/.cargo | |
key: ${{ runner.os }}-rust-${{ hashFiles('Cargo.lock') }} | |
- name: Build | |
run: cargo make build | |
- name: Test | |
run: cargo make test | |
- name: Generate documentation | |
run: cargo doc --no-deps --document-private-items | |
# Cache the runner details after the build and test steps | |
- name: Cache runner details after build and test | |
uses: actions/cache@v2 | |
with: | |
path: ~/.cargo | |
key: ${{ runner.os }}-rust-${{ hashFiles('Cargo.lock') }} | |
- name: Publish documentation as GitHub page | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GH_PAGES_TOKEN }} | |
publish_dir: ./target/doc | |
- name: Publish to crates.io | |
run: cargo publish | |
env: | |
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} |