-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (63 loc) · 2.54 KB
/
generate-docs.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
64
65
66
67
68
69
70
71
72
73
74
75
76
name: Generate Resume & Create Release
on:
push:
paths:
- "resume/**" # Trigger when files in the resume directory are updated
workflow_dispatch:
jobs:
build-and-release:
name: Build Resume and Create Release
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Generate various formats
run: |
set -e
DATE=$(date +"%Y-%m-%d")
mkdir -p resume/output
# Build PDF using XeLaTeX
docker run --rm \
-v ${PWD}:/workspace -w /workspace \
docker.io/danpilch/cv-build:v5 \
xelatex -jobname=danpilch-resume-${DATE} -output-directory=resume/output resume/resume.tex
# Build HTML
docker run --rm \
-v ${PWD}:/workspace -w /workspace \
docker.io/danpilch/cv-build:v5 \
make4ht --utf8 -a debug -B .build -f html5+inlinecss --output-dir ./resume/output/ -l ./resume/resume.tex "xelatex"
# Set name of HTML and CSS resume
mv ./resume/output/resume.html ./resume/output/danpilch-resume-${DATE}.html
mv ./resume/output/resume.css ./resume/output/danpilch-resume-${DATE}.css
# Build Markdown (requires Pandoc in the container)
sed -E \
-e 's/\\runsubsection\{([^}]*)\}/\\section{\1}/g' \
-e 's/\\descript\{\|\s*([^}]*)\}/\\textbf{\1}/g' \
-e 's/\\location\{([^}]*)\}/\\emph{\1}/g' \
-e 's/tightemize/itemize/g' \
-e 's/\\sectionsep//g' \
./resume/resume.tex > resume_tmp.tex
docker run --rm \
-v ${PWD}:/workspace -w /workspace \
docker.io/danpilch/cv-build:v5 \
pandoc -s resume_tmp.tex -o ./resume/output/danpilch-resume-${DATE}.md
- name: Create Unique Git Tag
id: create_tag
run: |
TIMESTAMP=$(date +"%Y-%m-%d-%H%M%S")
TAG="resume-${TIMESTAMP}"
git tag "$TAG"
git push origin "$TAG"
echo "tag_name=$TAG" >> $GITHUB_ENV
- name: Upload All Resumes to Release
uses: softprops/action-gh-release@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag_name: ${{ env.tag_name }}
files: |
resume/output/danpilch-resume-*.pdf
resume/output/danpilch-resume-*.html
resume/output/danpilch-resume-*.css
resume/output/danpilch-resume-*.md
- name: Notify Success
run: echo "Resume files generated and attached to release."