2020-03-03 15:01:25 +01:00
|
|
|
name: github pages
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2020-03-03 15:44:01 +01:00
|
|
|
tags:
|
|
|
|
- '*'
|
2020-03-03 15:01:25 +01:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
deploy:
|
|
|
|
runs-on: ubuntu-18.04
|
|
|
|
steps:
|
2020-03-03 15:44:01 +01:00
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
2020-03-03 15:57:26 +01:00
|
|
|
- name: Set CURRENT_TWO_WEEKS for use in cache keys
|
|
|
|
run: echo "::set-env name=CURRENT_TWO_WEEKS::$(($(date +%V) / 2))"
|
|
|
|
|
2020-03-03 15:44:01 +01:00
|
|
|
- name: Cache cargo registry
|
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
|
|
|
path: ~/.cargo/registry
|
2020-03-03 15:57:26 +01:00
|
|
|
key: ${{ runner.os }}-cargo-registry-${{ env.CURRENT_TWO_WEEKS }}
|
2020-03-03 15:44:01 +01:00
|
|
|
|
|
|
|
- name: Cache cargo index
|
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
|
|
|
path: ~/.cargo/git
|
2020-03-03 15:57:26 +01:00
|
|
|
key: ${{ runner.os }}-cargo-index-${{ env.CURRENT_TWO_WEEKS }}
|
|
|
|
|
|
|
|
- name: Cache mdbook binary
|
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
|
|
|
path: ~/.cargo/bin/mdbook
|
|
|
|
key: ${{ runner.os }}-cargo-mdbook-${{ env.CURRENT_TWO_WEEKS }}
|
2020-03-03 15:01:25 +01:00
|
|
|
|
|
|
|
- name: Build mdbook
|
2020-03-03 15:44:01 +01:00
|
|
|
run: cargo install mdbook
|
|
|
|
|
2020-08-28 16:45:24 +02:00
|
|
|
- name: Build cargo-readme
|
|
|
|
run: cargo install cargo-readme
|
|
|
|
|
|
|
|
- name: Build README.md
|
|
|
|
run: cargo readme > README.md
|
|
|
|
|
2020-03-03 15:01:25 +01:00
|
|
|
- name: Build
|
|
|
|
run: mdbook build
|
|
|
|
|
|
|
|
- name: Deploy
|
|
|
|
uses: peaceiris/actions-gh-pages@v3
|
|
|
|
with:
|
|
|
|
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
|
|
|
publish_dir: ./book
|