forked from mbg/uow-exam
-
Notifications
You must be signed in to change notification settings - Fork 2
75 lines (63 loc) · 2.32 KB
/
Copy pathpdf.yml
File metadata and controls
75 lines (63 loc) · 2.32 KB
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
name: CI
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Initialisation
env:
SB_USER: ${{ secrets.SB_USER }}
SB_PASSWORD: ${{ secrets.SB_PASSWORD }}
id: init
run: |
mkdir bin
unset HAS_SECRET
if [[ -n "$SB_PASSWORD" ]]; then HAS_SECRET='true' ; fi
echo ::set-output name=HAS_SECRET::${HAS_SECRET}
- name: Compile without solutions
uses: dante-ev/latex-action@v0.2.0
with:
root_file: cs141-sample-2021.tex
args: -bibtex -pdf -latexoption=-file-line-error -latexoption=-interaction=nonstopmode -latexoption=-shell-escape -latexoption=-synctex=1
- name: Upload build artifact (without solutions)
uses: actions/upload-artifact@v2
with:
name: cs141-sample-2021.pdf
path: cs141-sample-2021.pdf
- name: Compile with solutions
uses: dante-ev/latex-action@v0.2.0
with:
root_file: cs141-sample-2021-solutions.tex
args: -bibtex -pdf -latexoption=-file-line-error -latexoption=-interaction=nonstopmode -latexoption=-shell-escape -latexoption=-synctex=1
- name: Upload build artifact (with solutions)
uses: actions/upload-artifact@v2
with:
name: cs141-sample-2021-solutions.pdf
path: cs141-sample-2021-solutions.pdf
- name: Download uow-util
if: ${{ steps.init.outputs.HAS_SECRET }}
uses: Legion2/download-release-action@v2.1.0
with:
repository: mbg/uow-apis
tag: 'latest'
path: bin
file: uow-util
- name: Publish to Sitebuilder
if: ${{ steps.init.outputs.HAS_SECRET }}
env:
UOW_USER: ${{ secrets.SB_USER }}
UOW_PASSWORD: ${{ secrets.SB_PASSWORD }}
run: |
sudo chmod +x ./bin/uow-util
./bin/uow-util sitebuilder upload --page /fac/sci/dcs/teaching/material/cs141 --file cs141-sample-2021.pdf --name cs141-sample-2021.pdf
./bin/uow-util sitebuilder upload --page /fac/sci/dcs/teaching/material/cs141 --file cs141-sample-2021-solutions.pdf --name cs141-sample-2021-solutions.pdf
- uses: iRoachie/slack-github-actions@v2.3.0
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_CS141_WEBHOOK_URL }}
with:
status: ${{ job.status }}
if: always()