-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (68 loc) · 2.43 KB
/
100_render.yml
File metadata and controls
83 lines (68 loc) · 2.43 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
76
77
78
79
80
81
82
name: 100_render_notes.yml
## GENERAL form of 100_emacs_notes.yaml
## TODO:
## issues with gettting file name correct.
## run manuually
run-name: 100_render general
on:
workflow_dispatch:
inputs:
selected_filename:
description: 'Enter the name of the file.'
required: true
type: choice
options:
- tech_notes/001_grep_regex_P_examples.qmd
- tech_notes/002_grep_examples.qmd
- tech_notes/250_quarto_knitr_SCSS_NOTES.qmd
- tech_notes/280_emacs_notes.qmd
- tech_notes/300_tech_notes.qmd
- tech_notes/310_R_notes.qmd
- tech_notes/810_pharmaverse_NOTES.qmd
- tech_notes/910_basic_conditions_NOTES.qmd
- jobs/2025_clinical_trials_resume.qmd
permissions:
contents: write
jobs:
quarto:
runs-on: ubuntu-latest
steps:
- name: echo the selected_file
run: |
echo "You selected this file ${{ github.event.inputs.selected_filename }}"
- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true
- name: Checkout repository
uses: actions/checkout@v4.2.2
- name: Set up Quarto
uses: quarto-dev/quarto-actions/setup@v2
with:
version: LATEST
- name: install knitr
run: Rscript -e 'install.packages("knitr")'
- name: install rmarkdown, et al
run: Rscript -e 'install.packages(c("rmarkdown", "rlang", "lubridate"))'
- name: create output file name, then use in next chunk
run: echo "Begin ${{ github.event.inputs.selected_filename }}"
- name: Render Quarto document
run: |
quarto render ${{ github.event.inputs.selected_filename }} \
--to gfm --output jobs.md
#quarto render 250_quarto_knitr_SCSS_NOTES.qmd --to gfm --output 250_quarto_knitr_SCSS_NOTES.md
#quarto render README.Rmd --to gfm --output README.md
- name: Render pdf
run: |
echo "Begin pdf"
quarto render ${{ github.event.inputs.selected_filename }} \
--to pdf --output jobs
- name: Commit rendered file
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add . # above line did not work?
git commit -m "Update ${{ github.event.inputs.selected_filename }}" || \
echo "no changes; nothing to commit"
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}