Rework sorting logic #31
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Typst document | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
types: [opened, synchronize] | |
workflow_dispatch: | |
env: | |
ROOT_DIR: ./ | |
FONT_DIR: fonts/ | |
DEPLOY_BRANCH: deploy | |
# Allow one concurrent deployment | |
concurrency: | |
group: "deploy" | |
cancel-in-progress: true | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
build: | |
name: Build PDFs | |
runs-on: ubuntu-24.04 | |
permissions: | |
contents: write | |
strategy: | |
matrix: | |
include: | |
- name: CV | |
file: "src/cv.typ" | |
output: "cv.pdf" | |
- name: CV (EU) | |
file: "src/cv-eu.typ" | |
output: "cv-eu.pdf" | |
- name: Resume | |
file: "src/resume.typ" | |
output: "resume.pdf" | |
- name: Resume (One Page) | |
file: "src/resume-onepage.typ" | |
output: "resume-onepage.pdf" | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Typst | |
uses: typst-community/setup-typst@v3 | |
- name: Build PDF | |
run: typst compile --font-path ${{ env.FONT_DIR }} --root ${{ env.ROOT_DIR }} ${{ matrix.file }} ${{ matrix.output }} | |
- name: Upload PDFs | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.name }} | |
path: ${{ matrix.output }} | |
if-no-files-found: error | |
deploy: | |
name: Deploy to GitHub Branch | |
needs: [build] | |
runs-on: ubuntu-24.04 | |
if: ${{ needs.build.result == 'success' && github.ref == 'refs/heads/main' }} | |
steps: | |
- name: Setup Git Client | |
run: | | |
git config --global user.name "GitHub Actions" | |
git config --global user.email "actions@github.com" | |
- name: Download PDFs | |
uses: actions/download-artifact@v4 | |
with: | |
path: out/ | |
merge-multiple: true | |
- name: ls | |
run: ls -lah out/ | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
ref: '${{ env.DEPLOY_BRANCH }}' | |
path: 'deploy' | |
fetch-depth: 0 | |
- name: Commit and Push Changes | |
run: | | |
mv deploy/.git deploy-git | |
rm -rf deploy | |
mkdir deploy | |
sudo chmod -R 777 out/ | |
mv out/*.pdf deploy/ | |
mv deploy-git deploy/.git | |
cd deploy | |
git add . | |
git commit -m "Update Artifacts for ${{ github.ref_name }}" -m "Commit: ${{ github.sha }}" | |
git push --force origin ${{ env.DEPLOY_BRANCH }} |