rendercv/.github/workflows/deploy-docs.yaml

94 lines
2.7 KiB
YAML
Raw Normal View History

2023-10-14 20:41:08 +00:00
name: Deploy documentation
2024-02-18 20:40:03 +00:00
# GitHub events that triggers the workflow:
2023-09-10 17:36:13 +00:00
on:
push:
2024-02-18 20:40:03 +00:00
branches: ["main"]
2023-09-10 17:36:13 +00:00
permissions:
contents: write
2023-09-10 17:36:13 +00:00
jobs:
deploy:
runs-on: ubuntu-latest
steps:
2024-02-18 20:40:03 +00:00
- uses: actions/checkout@v4
with:
submodules: recursive
2024-02-18 20:40:03 +00:00
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
2023-09-10 17:36:13 +00:00
with:
2024-02-18 20:40:03 +00:00
python-version: ${{ matrix.python-version }}
2024-06-19 11:42:59 +00:00
- name: Install Hatch
uses: pypa/hatch@install
2024-02-18 20:40:03 +00:00
- name: Store cache ID
run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
- name: Create a key
uses: actions/cache@v4
2023-09-10 17:36:13 +00:00
with:
key: mkdocs-material-${{ env.cache_id }}
path: .cache
restore-keys: |
mkdocs-material-
2024-02-18 20:40:03 +00:00
- name: Deploy documentation
run: |
2024-06-19 11:34:05 +00:00
hatch run docs:deploy
- name: Update schema.json
run: |
hatch run docs:update-schema
- name: Update `examples` folder
run: |
hatch run docs:update-examples
- name: Update entry figures
run: |
hatch run docs:update-entry-figures
- name: Check if there are changes
uses: dorny/paths-filter@v3
id: changes
with:
filters: |
schema:
- schema.json
examples:
- examples/*.yaml
entry-figures:
- docs/assets/**/*.png
- name: Update schema.json
if: steps.changes.outputs.schema == 'true'
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add schema.json
git commit -m "docs: update schema.json"
- name: Update `examples` folder
if: steps.changes.outputs.examples == 'true'
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add examples/*
git commit -m "docs: update examples"
- name: Update entry figures
if: steps.changes.outputs.entry-figures == 'true'
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add docs/assets/**/*.png
git commit -m "docs: update entry figures"
- name: Push changes
if: steps.changes.outputs.schema == 'true' || steps.changes.outputs.examples == 'true' || steps.changes.outputs.entry-figures == 'true'
run: |
git push