forked from rybakit/cv.template
-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (37 loc) · 1.38 KB
/
ci.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
name: Generate CVs
on:
workflow_dispatch:
push:
# env:
# CV_FILENAME: J_Codemaster_CV
jobs:
generate:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout Repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y pandoc texlive-xetex texlive-fonts-recommended texlive-fonts-extra
pip install jinja2-cli jinja2_markdown
- name: Generate CVs
run: make cv && ls -l output
- name: Retrieve Version
id: version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
echo "PREFIX=$(date '+%Y-%m-%d')" >> $GITHUB_OUTPUT
echo "HASH=$(find output -type f -exec md5sum {} \; | sort -k 2 | cksum | awk '{print $1;}')" >> $GITHUB_OUTPUT
echo "PREV_HASH=$(gh release list --limit 1 --json 'tagName' --jq '.[].tagName | split(".")[-1]')" >> $GITHUB_OUTPUT
- name: Create Release
if: steps.version.outputs.HASH != steps.version.outputs.PREV_HASH
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAG: v${{ steps.version.outputs.PREFIX }}.${{ steps.version.outputs.HASH }}
run: |
gh release create "$TAG" --title "$TAG"
gh release upload "$TAG" output/*