Skip to content

Survival2

Survival2 #274

Workflow file for this run

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: Setup R
uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true
r-version: "4.2.2"
- name: Install rmarkdown
run: Rscript -e 'install.packages("rmarkdown")'
- 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)