Skip to content

Merge commit 'd71e016fc2dc650ec0b7dd5c18e561e46b1ca9be' #115

Merge commit 'd71e016fc2dc650ec0b7dd5c18e561e46b1ca9be'

Merge commit 'd71e016fc2dc650ec0b7dd5c18e561e46b1ca9be' #115

Workflow file for this run

name: Document Deployment
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout Docs Repo
uses: actions/checkout@v4
- name: Setup typst
uses: typst-community/setup-typst@v4
- name: Build files
run: |
find . -name '*.typ' | while read typ_file; do
rel_path="${typ_file#./}"
pdf_path="${rel_path%.typ}.pdf"
mkdir -p "compiled/$(dirname "$pdf_path")"
typst compile --root . "$typ_file" "compiled/$pdf_path"
done
- name: Deploy to Site Repo
env:
GITHUB_TOKEN: ${{ secrets.TOKENSEGRETISSIMO }}
run: |
git clone "https://oauth2:$GITHUB_TOKEN@github.com/Sigma18Unipd/sigma18unipd.github.io.git" RepoSito
mkdir -p temp/candidatura temp/rtb temp/pb
cd RepoSito
mv ./documentiCompilati/1-candidatura/verbali/esterni/* ../temp/candidatura
mv ./documentiCompilati/2-RTB/verbali/esterni/* ../temp/rtb
mv ./documentiCompilati/3-PB/verbali/esterni/* ../temp/pb
rm -rf ./documentiCompilati/*
cp -r ../compiled/* ./documentiCompilati
rm -rf ./documentiCompilati/templates
mv ../temp/candidatura/* ./documentiCompilati/1-candidatura/verbali/esterni
mv ../temp/rtb/* ./documentiCompilati/2-RTB/verbali/esterni
mv ../temp/pb/* ./documentiCompilati/3-PB/verbali/esterni
cd ..
python3 .github/workflows/generate_html.py
cd RepoSito
git config user.name "GitHub Actions"
git config user.email "actions@github.com"
git add .
git commit -m "Update documents: $(date +'%Y-%m-%d')"
git push origin main