Web #10
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: Web | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
schedule: | |
- cron: '11 7 * * 1,4' | |
jobs: | |
web: | |
name: Build and deploy site and docs | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
- name: Cache web cargo dependencies | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-web-cargo-${{ hashFiles('**/Cargo.lock') }} | |
- name: Install mdbook | |
run: | | |
mkdir mdbook | |
curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.14/mdbook-v0.4.14-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=./mdbook | |
echo `pwd`/mdbook >> $GITHUB_PATH | |
- name: Run mdbook build | |
run: | | |
cd book | |
mdbook build | |
- name: Install oranda | |
run: curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/oranda/releases/download/v0.4.1/oranda-installer.sh | sh | |
- name: Run oranda | |
run: oranda build | |
- name: Deploy | |
uses: JamesIves/[email protected] | |
if: ${{ github.ref == 'refs/heads/main' }} | |
with: | |
branch: gh-pages | |
folder: public | |
token: ${{ secrets.GITHUB_TOKEN }} | |
single-commit: true |