Create docs.yml workflow
I've created the `frost-book` Firebase project but couldn't create the service account key for it as the key gen permissions seem to be locked down.: https://github.com/w9jds/firebase-action
This commit is contained in:
parent
5c5ad14de4
commit
7828d58574
|
@ -0,0 +1,85 @@
|
|||
name: Docs
|
||||
|
||||
# Ensures that only one workflow task will run at a time. Previous deployments, if
|
||||
# already in process, won't get cancelled. Instead, we let the first to complete
|
||||
# then queue the latest pending workflow, cancelling any workflows in between
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: false
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
# doc source files
|
||||
- 'book/**'
|
||||
- '**/firebase.json'
|
||||
- 'katex-header.html'
|
||||
# rustdoc source files
|
||||
- '**/*.rs'
|
||||
- '**/Cargo.toml'
|
||||
- '**/Cargo.lock'
|
||||
# configuration files
|
||||
- '.cargo/config.toml'
|
||||
- '**/clippy.toml'
|
||||
# workflow definitions
|
||||
- '.github/workflows/docs.yml'
|
||||
|
||||
env:
|
||||
RUST_LOG: info
|
||||
RUST_BACKTRACE: full
|
||||
RUST_LIB_BACKTRACE: full
|
||||
COLORBT_SHOW_HIDDEN: '1'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build and Deploy Docs (+beta)
|
||||
timeout-minutes: 45
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout the source code
|
||||
uses: actions/checkout@v3.3.0
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Install last version of Protoc
|
||||
uses: arduino/setup-protoc@v1.1.2
|
||||
with:
|
||||
# TODO: increase to latest version after https://github.com/arduino/setup-protoc/issues/33 is fixed
|
||||
version: '3.20.1'
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Install latest beta
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: beta
|
||||
components: rust-docs
|
||||
override: true
|
||||
|
||||
- uses: Swatinem/rust-cache@v1
|
||||
|
||||
- name: Setup mdBook
|
||||
uses: peaceiris/actions-mdbook@v1.2.0
|
||||
with:
|
||||
mdbook-version: '0.4.18'
|
||||
|
||||
# TODO: actions-mdbook does not yet have an option to install mdbook-mermaid https://github.com/peaceiris/actions-mdbook/issues/426
|
||||
- name: Install mdbook
|
||||
run: |
|
||||
cargo install mdbook-mermaid
|
||||
|
||||
- name: Build FROST book
|
||||
run: |
|
||||
mdbook build book/
|
||||
|
||||
- name: Deploy FROST book to firebase
|
||||
uses: w9jds/firebase-action@v11.22.0
|
||||
with:
|
||||
args: deploy
|
||||
env:
|
||||
GCP_SA_KEY: ${{ secrets.GCP_SA_KEY }}
|
||||
PROJECT_PATH: book/
|
||||
PROJECT_ID: frost-book
|
||||
|
Loading…
Reference in New Issue