-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (54 loc) · 1.79 KB
/
build.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
on:
pull_request:
branches:
- main
name: build
jobs:
build-book:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.ref }}
- name: Check TODO/FIXMEs
run: |
#!/bin/bash
# Search TODO/FIXME and strip whitespace
count=$(grep -Rniwo --include="*.qmd" -e 'TODO\|FIXME' book/ | wc -l)
count=$(echo "$count" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')
# Warn if count>0
if [ "$count" -gt 0 ]; then
echo "::warning::There are $count FIXMEs/TODOs."
fi
shell: bash
- name: Install Quarto
uses: quarto-dev/quarto-actions/setup@v2
with:
tinytex: true
- name: Render book
run: make render
- name: Upload pdf book
uses: actions/upload-artifact@v4
with:
name: MLSA
path: book/_book/Machine-Learning-in-Survival-Analysis.pdf
overwrite: true
retention-days: 5
- name: Add & Commit
if: ${{ github.event_name == 'pull_request' }}
uses: EndBug/[email protected]
with:
add: book/_book/Machine-Learning-in-Survival-Analysis.pdf --force
message: "Push pdf [skip ci]"
- name: Comment link to pdf
if: ${{ github.event_name == 'pull_request' }}
uses: thollander/actions-comment-pull-request@v2
with:
comment_tag: preview
message: |
[Book :open_book:](https://github.com/mlsa-book/MLSA/blob/${{ github.event.pull_request.head.ref }}/book/_book/Machine-Learning-in-Survival-Analysis.pdf)