Skip to content

Merge pull request #2 from ckhordiasma/test-revision #6

Merge pull request #2 from ckhordiasma/test-revision

Merge pull request #2 from ckhordiasma/test-revision #6

Workflow file for this run

name: "Build and release PDFs"
on:
push:
tags:
- '*'
pull_request:
branches: [ master, main ]
paths:
- "**/*.tex"
- "**/*.bib"
jobs:
build:
runs-on: ubuntu-latest
container:
image: ghcr.io/moderncv/debian-texlive-docker:main
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Build resume PDFs # the forward slash after asterisk is important for ignoring regular files
run: |
for folder in $(ls -d resumes/*/ | grep -v "resumes/header"); do
cd $folder && ls
NAME=$(basename "$folder")
SUFFIX=$(echo '${{github.ref_name}}' | sed 's|/|-|g')
latexmk -pdf -jobname="$NAME-$SUFFIX"
cd -
done
- name: Build cover letter PDFs
run: |
for folder in $(ls -d cover-letters/*/ | grep -v "cover-letters/header"); do
cd $folder && ls
NAME=$(basename "$folder")
SUFFIX=$(echo '${{github.ref_name}}' | sed 's|/|-|g')
latexmk -pdf -jobname="cover-$NAME-$SUFFIX"
cd -
done
- name: Upload PDFs
uses: actions/upload-artifact@v4
with:
name: docs
path: |
cover-letters/*/*.pdf
resumes/*/*.pdf
release:
needs: build
runs-on: ubuntu-latest
if: startsWith(github.ref_name, 'v') && github.ref_type == 'tag'
steps:
- name: make an artifacts directory
run: mkdir artifacts
- name: Download all workflow run artifacts
uses: actions/download-artifact@v4
with:
path: ./artifacts
merge-multiple: true
- name: Show artifacts
run: ls -R .
- name: Create a release
env:
GH_TOKEN: ${{ github.token }}
run: >
gh release create --latest --repo ${{github.repository}}
"r${{github.ref_name}}" ./artifacts/resumes/*/*.pdf ./artifacts/cover-letters/*/*.pdf