Skip to content

Try different approach for GH Pages #7

Try different approach for GH Pages

Try different approach for GH Pages #7

Workflow file for this run

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
- name: Add redirect to index.html
run: echo '<meta http-equiv="refresh" content="0;url=web3_closest_provider/index.html">' > target/doc/index.html
- name: Remove lock file
run: rm target/doc/.lock
# - name: Upload artifact
# uses: actions/upload-pages-artifact@v3
# with:
# path: target/doc
# 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 }}