[Draft] New finals #688
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: CI | |
on: [push, pull_request] | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: LaTeX linter (chktex) | |
uses: j2kun/[email protected] | |
# Provide this output for context, but don't fail builds | |
continue-on-error: true | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
build: | |
name: build-${{ matrix.document }} | |
runs-on: ubuntu-latest | |
container: texlive/texlive:TL2022-historic | |
needs: [lint] | |
strategy: | |
fail-fast: false | |
matrix: | |
document: [rulebook, scoresheets] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Take ownership of the checkout directory (Git CVE-2022-24765) | |
run: chown --recursive --reference=/ . | |
- name: Allow for file ownership conflicts with Docker and GitHub Actions | |
run: git config --global --add safe.directory '*' | |
- name: LaTeX compilation | |
run: | |
TERM=xterm make ${{ matrix.document }} | |
- name: Upload build result | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.document }} | |
path: .build/${{ matrix.document }}.pdf | |
deploy-pdfs: | |
name: deploy-pdfs | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
needs: [build] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: gh-pages | |
- name: Download rulebook | |
uses: actions/download-artifact@v4 | |
with: | |
name: rulebook | |
path: ${{ runner.temp }}/rulebook | |
- name: Download scoresheets | |
uses: actions/download-artifact@v4 | |
with: | |
name: scoresheets | |
path: ${{ runner.temp }}/scoresheets | |
- name: Preparations for GitHub Pages | |
if: github.ref_name == github.event.repository.default_branch | |
env: | |
ARTIFACTS_PATH: ${{ runner.temp }} | |
run: | | |
# Make sure directories exist | |
cd "${GITHUB_WORKSPACE}" | |
mkdir -p rulebook | |
mkdir -p scoresheets | |
FILENAME=${GITHUB_REF_NAME} | |
# Strip out any extra slashes in the rest | |
FILENAME=${FILENAME//\//\_}.pdf | |
mv ${ARTIFACTS_PATH}/rulebook/rulebook.pdf rulebook/${FILENAME} | |
mv ${ARTIFACTS_PATH}/scoresheets/scoresheets.pdf scoresheets/${FILENAME} | |
- name: Commit and push to GitHub Pages | |
if: github.ref_name == github.event.repository.default_branch | |
uses: stefanzweifel/git-auto-commit-action@v5 | |
with: | |
branch: gh-pages | |
commit_author: "Continuous Deployment <[email protected]>" | |
commit_message: "[github actions] deploy" | |
commit_user_name: "Continuous Deployment" | |
commit_user_email: "[email protected]" | |
file_pattern: "./*.pdf" | |
repository: ${{ github.workspace }} | |
skip_checkout: true | |
skip_fetch: true |