Merge pull request #227 from HuangFuSL/deployment-update #17
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: Deploy Documentation | |
on: | |
push: | |
branches: [main] | |
# Exclude dependabot | |
paths: | |
- '.github/**' | |
- 'docs/**' | |
- 'main/**' | |
- 'overrides/**' | |
- 'third_party/**' | |
- 'README.md' | |
- 'mkdocs.yml' | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
jobs: | |
deploy: | |
name: Deploy documentation | |
uses: ./.github/workflows/build.yml | |
with: | |
build-type: build | |
deploy: true | |
secrets: inherit | |
detect: | |
name: Detect changed LaTeX files | |
runs-on: ubuntu-latest | |
needs: deploy | |
outputs: | |
changed: ${{ steps.detect.outputs.changed }} | |
steps: | |
- name: Checkout gh-pages | |
uses: actions/checkout@v4 | |
with: | |
ref: gh-pages | |
fetch-depth: 2 | |
- name: Detect changed files | |
id: detect | |
run: | | |
if [[ -n $(git diff HEAD^ HEAD --name-only | grep '.tex$') ]]; then | |
echo "changed=true" >> $GITHUB_OUTPUT; | |
else | |
echo "changed=false" >> $GITHUB_OUTPUT; | |
fi | |
latex: | |
name: Compile LaTeX files | |
needs: detect | |
if: needs.detect.outputs.changed == 'true' | |
uses: ./.github/workflows/latex.yml | |
secrets: inherit | |
metrics: | |
name: Update metrics | |
needs: deploy | |
uses: ./.github/workflows/metric.yml | |
secrets: inherit |