Eha #345
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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@v3 | |
with: | |
name: MLSA | |
path: book/_book/Machine-Learning-in-Survival-Analysis.pdf | |
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) |