Skip to content

0.3.3 Release (#10) #27

0.3.3 Release (#10)

0.3.3 Release (#10) #27

Workflow file for this run

name: Publish docs via GitHub Pages
on:
push:
branches:
- main
permissions:
checks: write
pull-requests: write
contents: write
jobs:
build:
name: Deploy docs
runs-on: ubuntu-latest
steps:
- name: Checkout main
uses: actions/checkout@v2
with:
fetch-depth: 2
- shell: pwsh
# Give an id to the step, so we can reference it later
id: check_file_changed
run: |
# Diff HEAD with the previous commit
$diff = git diff --name-only HEAD^ HEAD
# Check if a file under docs/ or with the .md extension has changed (added, modified, deleted)
$SourceDiff = $diff | Where-Object { $_ -match '^docs/' -or $_ -match '.md$' }
$HasDiff = $SourceDiff.Length -gt 0
# Set the output named "docs_changed"
Write-Host "::set-output name=docs_changed::$HasDiff"
- name: Copy readme
shell: pwsh
run: |
Copy-Item README.md docs/index.md
- name: Deploy docs
uses: mhausenblas/mkdocs-deploy-gh-pages@master
if: steps.check_file_changed.outputs.docs_changed == 'True' || ${{ github.event_name == 'workflow_dispatch' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REQUIREMENTS: docs/requirements.txt