-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (61 loc) · 1.87 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: "Build and release PDFs"
on:
push:
branches: [ master, main ]
paths:
- "**/*.tex"
pull_request:
branches: [ master, main ]
paths:
- "**/*.tex"
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")
latexmk -pdf -jobname="$NAME-r${{github.run_number}}"
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")
latexmk -pdf -jobname="cover-$NAME-r${{github.run_number}}"
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: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main'
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.run_number}}" ./artifacts/resumes/*/*.pdf ./artifacts/cover-letters/*/*.pdf