-
-
Notifications
You must be signed in to change notification settings - Fork 127
46 lines (42 loc) · 1.38 KB
/
build-template.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
name: Build the LaTeX template
on:
push:
branches:
- main
pull_request:
env:
VERSION_FILE: NOVAthesisFiles/nt-version.sty
EMAIL_GITHUB: [email protected]
USERNAME_GITHUB: joaomlourenco
permissions: write-all
jobs:
build:
runs-on: ubuntu-latest
if: github.actor != 'my_bot_account'
steps:
- name: Checkout the repository
uses: actions/checkout@v3
with:
ref: main
token: ${{ secrets.GITHUB_TOKEN }}
- name: Extract version number from nt-version.sty
run: |
version=$(grep novathesisversion $VERSION_FILE | cut -d "{" -f3 | cut -d "}" -f1)
echo "Version number is $version"
- name: Compile the LaTeX template
uses: xu-cheng/texlive-action/full@v1
with:
run: bash .Build/build.sh
- name: Upload the template PDF file
uses: actions/upload-artifact@v3
with:
name: Template
path: template.pdf
- name: Push changes to the repository
run: |
version=$(grep novathesisversion $VERSION_FILE | cut -d "{" -f3 | cut -d "}" -f1)
git config --global user.email "$EMAIL_GITHUB"
git config --global user.name "$USERNAME_GITHUB"
git add -f template.pdf
git commit -m "Version $(grep novathesisversion $VERSION_FILE | cut -d '{' -f3 | cut -d '}' -f1)"
git push