Skip to content

Merge pull request #18 from geotribu/dependabot/github_actions/action… #73

Merge pull request #18 from geotribu/dependabot/github_actions/action…

Merge pull request #18 from geotribu/dependabot/github_actions/action… #73

Workflow file for this run

name: "🚀 Build & publish"
on:
push:
branches: [main]
schedule:
- cron: "0 0 1 * *" # monthly
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# 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: "pages"
cancel-in-progress: true
jobs:
deploy:
name: "📤 GitHub Pages"
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
if: github.event.repository.fork == false
steps:
- name: Get source code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install system dependencies # for optimize plugin
uses: awalsh128/cache-apt-pkgs-action@v1
with:
packages: pngquant
version: 1.0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.11
cache: "pip"
- name: Cache build dependencies (external assets downloaded)
uses: actions/cache@v3
with:
key: ${{ github.ref }}
path: .cache
- name: Install Python dependencies
env:
GH_TOKEN_MATERIAL_INSIDERS: ${{ secrets.GH_TOKEN_MATERIAL_INSIDERS }}
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install --upgrade -r requirements.txt
- name: Build PyQGIS cheatsheet page
run: |
python qrc_preview_in_md.py
cp README.md docs/credits.md
git config --global user.name "Geotribu (Github Action)"
git config --global user.email "geotribu@gmail.com"
git add docs/*.md
git commit -m "Updating PyQGIS cheatsheet"
- name: Build static website
run: |
mkdocs build --clean --config-file mkdocs.yml --verbose --strict
env:
MKDOCS_ENABLE_PLUGIN_GIT_DATES: true
MKDOCS_ENABLE_PLUGIN_OPTIMIZE: true
MKDOCS_ENABLE_PLUGIN_PRIVACY: true
MKDOCS_ENABLE_PLUGIN_SOCIAL: true
MKDOCS_ENABLE_PLUGIN_SOCIAL_CARDS: true
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
# Upload entire repository
path: site/
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4