mirror of
https://github.com/NotXia/unibo-ai-notes.git
synced 2025-12-14 18:51:52 +01:00
65 lines
1.8 KiB
YAML
65 lines
1.8 KiB
YAML
name: Compile LaTeX
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
paths: [
|
|
"src/**",
|
|
.github/update_readme.py,
|
|
.github/read_metadata.py,
|
|
.github/workflows/compile.yml,
|
|
compile.sh
|
|
]
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
compile:
|
|
name: Compile notes
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout repo
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Checkout current pdfs branch
|
|
uses: actions/checkout@v4
|
|
with:
|
|
ref: pdfs
|
|
path: .currpdfs
|
|
|
|
|
|
- name: Prepare output directory
|
|
run: |
|
|
mkdir ${GITHUB_WORKSPACE}/.compiled
|
|
cp ${GITHUB_WORKSPACE}/LICENSE-pdf ${GITHUB_WORKSPACE}/.compiled/LICENSE
|
|
|
|
- name: Compile
|
|
run: |
|
|
docker pull ghcr.io/notxia/unibo-ai-notes:main
|
|
docker run -v ${GITHUB_WORKSPACE}:/notes ghcr.io/notxia/unibo-ai-notes:main
|
|
|
|
- name: Generate README
|
|
run: |
|
|
cp README.md .compiled/README.md
|
|
python3 ${GITHUB_WORKSPACE}/.github/update_readme.py \
|
|
--src-path ${GITHUB_WORKSPACE}/src \
|
|
--readme-path ${GITHUB_WORKSPACE}/.compiled/README.md \
|
|
--gh-link https://raw.githubusercontent.com/NotXia/unibo-ai-notes/pdfs
|
|
|
|
- name: Move to pdfs branch
|
|
uses: s0/git-publish-subdir-action@develop
|
|
env:
|
|
REPO: self
|
|
BRANCH: pdfs
|
|
FOLDER: .compiled
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
COMMIT_NAME: "github-actions[bot]"
|
|
COMMIT_EMAIL: "github-actions[bot]@users.noreply.github.com"
|
|
MESSAGE: "🤖 Hello human, trying to not break anything ({sha})"
|
|
SKIP_EMPTY_COMMITS: true |