Cache graphs

This commit is contained in:
tooomm 2026-07-22 20:20:50 +02:00 • committed by GitHub
parent ae37762ee1
commit 4db6b599cd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,4 +1,4 @@
name: Generate Docs name: Build Docs
on: on:
pull_request: pull_request:
@ -10,6 +10,11 @@ on:
types: types:
- published # publishing of stable releases and pre-releases - published # publishing of stable releases and pre-releases
workflow_dispatch: workflow_dispatch:
inputs:
evict_cache:
description: "Evict Doxygen graph cache"
type: boolean
default: false
env: env:
COCKATRICE_REF: ${{ github.ref_name }} # tag name if the commit is tagged, otherwise branch name COCKATRICE_REF: ${{ github.ref_name }} # tag name if the commit is tagged, otherwise branch name
@ -20,7 +25,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: "Checkout code" - name: "Checkout source code"
uses: actions/checkout@v7 uses: actions/checkout@v7
with: with:
submodules: recursive submodules: recursive
@ -48,16 +53,29 @@ jobs:
exit 1 exit 1
fi fi
- name: "Restore graph cache from GH Pages repo"
if: github.event_name != 'workflow_dispatch' || inputs.evict_cache == false
continue-on-error: true
uses: actions/checkout@v7
with:
repository: Cockatrice/cockatrice.github.io
path: doxygen-output # where GH pages root will be placed, needs to match Doxygen OUTPUT_DIRECTORY
token: ${{ github.token }}
sparse-checkout: |
docs/**/*.md5
docs/**/*.svg # Doxygen DOT_IMAGE_FORMAT
sparse-checkout-cone-mode: false
- name: "Generate Documentation" - name: "Generate Documentation"
if: always() if: always()
run: doxygen Doxyfile run: doxygen Doxyfile
- name: "Deploy to cockatrice.github.io" - name: "Deploy to cockatrice.github.io"
if: github.event_name == 'release' || github.event_name == 'workflow_dispatch' if: github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/master')
uses: peaceiris/actions-gh-pages@v4 uses: peaceiris/actions-gh-pages@v4
with: with:
deploy_key: ${{ secrets.DOCS_DEPLOY_KEY }} deploy_key: ${{ secrets.DOCS_DEPLOY_KEY }}
destination_dir: docs # docs will be available at https://cockatrice.github.io/docs/ destination_dir: docs # path where the documentation will live (https://cockatrice.github.io/docs/)
external_repository: Cockatrice/cockatrice.github.io external_repository: Cockatrice/cockatrice.github.io
publish_branch: master publish_branch: master
publish_dir: ./docs/html publish_dir: ./doxygen-output/docs/ # needs to match Doxygen "./OUTPUT_DIRECTORY/HTML_OUTPUT/"