Skip to content

📝 docs(README): adds workflow notes #6

📝 docs(README): adds workflow notes

📝 docs(README): adds workflow notes #6

name: Compile and build all latex documents
on:
# Triggers the workflow on push or pull request events but only for the default branch
push:
branches: [ "main", "master" ]
pull_request:
branches: [ "main", "master" ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Defines concurrent policies for the workflow, for example, if a commit is made while
# the workflow is running, should the current run be cancelled or should the new run be queued
# Docs: https://stackoverflow.com/questions/66335225/how-to-cancel-previous-runs-in-the-pr-when-you-push-new-commitsupdate-the-curre
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
GRADLE_TASK_NAME: "buildAllPdfs"
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# The permissions that the GitHub token has
permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the
# added or changed files to the repository.
contents: write
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# docs: https://github.com/EndBug/add-and-commit?tab=readme-ov-file#faqs
- if: ${{ github.event_name == 'pull_request'}}
name: PR checkout
uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- if: ${{ github.event_name != 'pull_request'}}
name: Normal checkout
uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 19
- name: Setup Gradle
uses: gradle/gradle-build-action@v3
# docs: https://github.com/actions/starter-workflows/issues/171
- name: Make gradlew executable
run: chmod +x ./gradlew
- name: Install and Update MikTeX
run: |
echo "${HOME}/bin" >> $GITHUB_PATH
set -e
sudo gpg --homedir /tmp --no-default-keyring --keyring /usr/share/keyrings/miktex.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys D6BC243565B2087BC3F897C9277A7293F59E4889
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/miktex.gpg] https://miktex.org/download/ubuntu jammy universe" | sudo tee /etc/apt/sources.list.d/miktex.list
sudo apt-get update -y -q
sudo apt-get install -qq -y --no-install-recommends miktex
miktexsetup --verbose finish
initexmf --verbose --set-config-value=[MPM]AutoInstall=1
miktex --verbose packages update-package-database
miktex --verbose packages update
miktex --verbose packages install cm-super amsfonts
miktex --verbose fontmaps configure
miktex --verbose fndb refresh
initexmf --verbose --update-fndb
initexmf --report > miktex-report.txt
- name: Compile and build all latex documents using Gradle
run: ./gradlew ${{ env.GRADLE_TASK_NAME }} --stacktrace
# Commit all changed files back to the repository
- name: Commit changes
uses: EndBug/add-and-commit@v9
with:
add: '*.pdf'
message: '🔄 ci(report): compiles and deploys latex documents'
default_author: github_actions