Files
default-beamer-presentation/.gitea/workflows/build-slides.yml

69 lines
1.8 KiB
YAML

name: Build LaTeX PDF
on:
push:
branches:
- main
- master
paths:
- '**.tex'
- '**.bib'
- '**.sty'
- '**.cls'
pull_request:
paths:
- '**.tex'
- '**.bib'
- '**.sty'
- '**.cls'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install TeX Live
run: |
apt-get update -qq
apt-get install -y --no-install-recommends \
texlive-full \
latexmk \
biber
- name: Compile LaTeX (main.tex)
run: |
latexmk -pdf -interaction=nonstopmode -file-line-error main.tex
- name: Upload PDF artifact
uses: actions/upload-artifact@v3
with:
name: main-pdf
path: main.pdf
if-no-files-found: error
retention-days: 30
- name: Install AWS CLI
run: |
apt-get install -y --no-install-recommends awscli
- name: Parse repo name into org/title
run: |
REPO_NAME="${{ gitea.event.repository.name }}"
ORG=$(echo "$REPO_NAME" | cut -d'-' -f1)
TITLE=$(echo "$REPO_NAME" | cut -d'-' -f2-)
echo "ORG=$ORG" >> $GITEA_ENV
echo "TITLE=$TITLE" >> $GITEA_ENV
- name: Upload PDF to Cloudflare R2
env:
AWS_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
run: |
aws s3 cp main.pdf s3://slides-louisgallet-fr/${{ env.ORG }}/${{ env.TITLE }}/${{ env.TITLE }}.pdf \
--endpoint-url https://7baa63440cdb96ec89d904b6aca641bf.eu.r2.cloudflarestorage.com \
--region auto \
--content-type application/pdf