-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (72 loc) · 3.03 KB
/
main.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
77
78
79
80
81
82
83
84
85
# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [ main ]
pull_request:
branches: [ main ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
# WIP: Download extra fonts
# - name: Install TeX Live packages # (Note that you may don't need some of them)
# run: sudo apt install -y texlive-base texlive-xetex texlive-lang-chinese latexmk
# - name: Download the fonts
# run: for i in simhei.ttf simkai.ttf simsun.ttc simsunb.ttf simfang.ttf; do wget -P fonts/ https://xugr.keybase.pub/static/fonts/$i; done
# - name: Copy the fonts # In newer version of fontconfig, it reads $HOME/.local/share/fonts/ but not $HOME/.fonts
# run: mkdir -p ~/.local/share/fonts && cp -r fonts/* ~/.local/share/fonts/
# - name: Build font information caches
# run: fc-cache -rv
# compile tex file
- name: LaTeX Action
uses: xu-cheng/latex-action@v2
with:
# The root LaTeX file to be compiled
root_file: resume.tex
latexmk_use_lualatex: true
latexmk_shell_escape: true
pre_compile: |
apk add msttcorefonts-installer fontconfig
update-ms-fonts
fc-cache -f
# format datetime to 'v2021.6.26'
- name: Set env
run: echo "::set-env name=NOW::$(date +'v%Y.%m.%d')"
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
# check if tag already exists in current day. If so, it will
# delete the current tag and replace with the new one
# check if tag already exists
- uses: mukunku/tag-exists-action@v1.0.0
id: checkTag
with:
tag: ${{ env.NOW }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# delete tag if exists
- uses: dev-drprasad/delete-tag-and-release@v0.2.1
if: ${{ steps.checkTag.outputs.exists }}
with:
delete_release: true # default: false
tag_name: ${{ env.NOW }} # tag name to delete
repo: anthonyive/resume # target repo (optional). defaults to repo running this action
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# create release
- name: Create release
uses: ncipollo/release-action@v1
with:
artifacts: "resume_${{ env.NOW }}.pdf"
tag: ${{ env.NOW }}
token: ${{ secrets.GITHUB_TOKEN }}