0.3.2 Release (#9) #25
This file contains hidden or 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: 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 |