Files
TUM-Formelsammlungen/.gitea/workflows/build-script.yaml
2026-01-13 10:49:02 +01:00

64 lines
1.8 KiB
YAML

# .gitea/workflows/typst-build.yml
name: Build Typst PDFs (Docker)
on:
push:
branches: [ "**" ]
pull_request:
branches: [ "**" ]
env:
TYPST_SOURCE_DIR: src
BUILD_DIR: build
jobs:
build-typst:
runs-on: ubuntu-latest
# Run the whole job inside a Docker container that has Typst installed
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1
submodules: false
lfs: false
- name: Debug Ls
run: ls -la "$PWD" && echo "$PWD && echo ${{ github.workspace }}"
- name: Build Typst builder image
uses: docker/build-push-action@v2
with:
tags: typst-builder-image:latest
push: false
- name: Compile all .typ files
uses: addnab/docker-run-action@v3
env:
TYPST_SOURCE_DIR: ${{ env.TYPST_SOURCE_DIR }}
BUILD_DIR: ${{ env.BUILD_DIR }}
with:
image: typst-builder-image:latest
options: --volumes-from=${{ env.JOB_CONTAINER_NAME }}
cwd: ${{ github.workspace }}
run: "cd ${{ github.workspace }} && TYPST_SOURCE_DIR=${{ env.TYPST_SOURCE_DIR }} BUILD_DIR=${{ env.BUILD_DIR }} bash -c ./compile-all.bash"
- name: Upload PDFs
if: always()
uses: actions/upload-artifact@v3
with:
name: typst-pdfs
path: ${{ env.BUILD_DIR }}/*.pdf
if-no-files-found: warn
- name: Create Gitea Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.tag.outputs.tag }}
name: Typst PDFs ${{ steps.tag.outputs.tag }}
body: |
Automated release of Typst-generated PDFs.
Commit: ${{ github.sha }}
files: ${{ env.BUILD_DIR }}/*.pdf