Merge pull request #64 from fredrikaverpil/dependabot/pip/mkdocs-rss-… #1
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: github pages | |
on: | |
push: | |
branches: | |
- main # Set a branch to deploy | |
workflow_dispatch: | |
pull_request: | |
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
# Allow one concurrent deployment | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
env: | |
USE_MKDOCS_MATERIAL_INSIDERS: false | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
environment: github-pages | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # for rss | |
# for social cards | |
- run: sudo apt-get install libcairo2-dev libfreetype6-dev libffi-dev libjpeg-dev libpng-dev libz-dev | |
- uses: actions/setup-python@v5 | |
with: | |
python-version-file: .python-version | |
- uses: actions/cache@v4 | |
with: | |
key: ${{ github.ref }} | |
path: | | |
~/.cache/pip | |
.cache | |
- name: Install Mkdocs-Material-Insiders | |
run: pip install --upgrade \ | |
git+https://${{ secrets.MKDOCS_MATERIAL_INSIDERS }}@github.com/squidfunk/mkdocs-material-insiders.git \ | |
mkdocs-rss-plugin \ | |
mkdocs-redirects \ | |
pillow cairosvg # for social cards | |
if: ${{ env.USE_MKDOCS_MATERIAL_INSIDERS == 'true' }} | |
- name: Install Mkdocs-Material | |
run: pip install -r requirements.txt | |
if: ${{ env.USE_MKDOCS_MATERIAL_INSIDERS == 'false' }} | |
- run: pip freeze | |
- run: mkdocs build | |
# maintain backwards compatibility from previous RSS feed | |
- run: cp site/static/rss_redirect.xml site/atom.xml | |
- name: Setup Pages | |
if: github.event_name != 'pull_request' | |
uses: actions/configure-pages@v5 | |
- name: Upload artifact | |
if: github.event_name != 'pull_request' | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: "./site" | |
- name: Deploy to GitHub Pages | |
if: github.event_name != 'pull_request' | |
id: deployment | |
uses: actions/deploy-pages@v4 |