Deploy to gh-pages #20
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: Deploy to gh-pages | |
on: | |
workflow_dispatch: | |
inputs: | |
dry-run: | |
type: boolean | |
description: Dry run (will build to 'gh-pages-test') | |
default: true | |
permissions: | |
contents: write | |
env: | |
INPUTS_DRYRUN: ${{ inputs.dry-run }} | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install dependencies | |
run: if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV | |
- uses: actions/cache@v3 | |
with: | |
key: mkdocs-material-${{ env.cache_id }} | |
path: .cache | |
restore-keys: | | |
mkdocs-material- | |
- run: mkdocs gh-deploy $(if ${INPUTS_DRYRUN};then echo "-b gh-pages-test --verbose";fi) --force |