thesis/.forgejo/workflows/publish.yaml
Jean-Marie Mineau e7a46aa2a9
All checks were successful
/ test_checkout (push) Successful in 41s
CI
2025-06-25 14:10:04 +02:00

33 lines
1.8 KiB
YAML

on: [push]
jobs:
test_checkout:
runs-on: docker
container:
image: ghcr.io/typst/typst:v0.13.1
steps:
- run: apk add --no-cache git curl
- run: |
mkdir /tmp/font
cd /tmp/font
curl -L -O http://www.gust.org.pl/projects/e-foundry/tex-gyre/whole/tg2_501otf.zip
unzip tg2_501otf.zip
install -Dt /usr/share/fonts/tex-gyre -m644 tg2_501otf/*.otf
mkdir -p ~/.local/share/typst/packages/local/template-thesis-matisse/
git clone https://git.mineau.eu/histausse/template-thesis-matisse.git ~/.local/share/typst/packages/local/template-thesis-matisse/0.0.1
- run: |
TOKEN=$(echo -n "x-access-token:${GITHUB_TOKEN}" | base64)
mkdir -p "${GITHUB_WORKSPACE}"
cd "${GITHUB_WORKSPACE}"
git init
git remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}"
git -c http.extraHeader="Authorization: Basic ${TOKEN}" fetch origin "${GITHUB_SHA}"
git checkout "${GITHUB_SHA}"
ls
- run: |
cd "${GITHUB_WORKSPACE}"
/bin/typst compile --input commit=$(git rev-parse --short HEAD) --font-path /usr/share/fonts/ main.typ
- run: |
curl -s --show-headers --user "histausse:${{secrets.TOKEN_HISTAUSSE_PACKAGE}}" -X DELETE "${GITHUB_SERVER_URL}/api/packages/these-ammii/generic/thesis/latest/draft.pdf"
curl -s --show-headers --user "histausse:${{secrets.TOKEN_HISTAUSSE_PACKAGE}}" --upload-file "${GITHUB_WORKSPACE}/main.pdf" "${GITHUB_SERVER_URL}/api/packages/these-ammii/generic/thesis/latest/draft.pdf"
# curl -s --show-headers --user "histausse:${{secrets.TOKEN_HISTAUSSE_PACKAGE}}" --upload-file "${GITHUB_WORKSPACE}/main.pdf" "${GITHUB_SERVER_URL}/api/packages/these-ammii/generic/thesis/${GITHUB_SHA}/draft.pdf"