Merge pull request #1 from 7rikazhexde/dependabot/github_actions/depe… #64
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
# GitHub Actions to automate deployment of project documentation | |
# Reference: https://squidfunk.github.io/mkdocs-material/publishing-your-site/?h=git+hub#github-pages | |
name: ci | |
on: | |
# 直接プッシュ時([skip ci]がないもの) | |
push: | |
branches: | |
- main | |
# 他のワークフローの完了時 | |
workflow_run: | |
workflows: | |
- "Update pre-commit Hooks" | |
- "Update Requirements after Dependabot Merge" | |
types: | |
- completed | |
branches: | |
- main | |
env: | |
cache_id: "" | |
permissions: | |
contents: write | |
jobs: | |
deploy: | |
# 条件分岐の整理 | |
if: (github.event_name == 'push' && !contains(github.event.head_commit.message, '[skip ci]')) || (github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success') | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: 3.x | |
- run: echo "cache_id=$(date --utc '+%V')" >> "$GITHUB_ENV" | |
- uses: actions/cache@v4 | |
with: | |
key: mkdocs-material-${{ env.cache_id }} | |
path: .cache | |
restore-keys: | | |
mkdocs-material- | |
- name: Install Poetry | |
run: pip install poetry | |
- name: Poetry Setup | |
run: poetry install | |
- name: Deploy GitHub Pages | |
run: poetry run mkdocs gh-deploy --force |