-
Notifications
You must be signed in to change notification settings - Fork 2
45 lines (38 loc) · 1.32 KB
/
render-README.qmd.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
name: Render QMD Files
on:
push:
branches:
- main # Adjust as needed
jobs:
render_qmd:
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@v2
- name: Install Quarto
run: |
wget https://github.com/quarto-dev/quarto-cli/releases/download/v1.2.269/quarto-1.2.269-linux-amd64.deb
sudo dpkg -i quarto-1.2.269-linux-amd64.deb
- name: Install R and Required Packages
env:
R_LIBS_USER: ~/R/library # Define a writable library path
run: |
sudo apt-get update
sudo apt-get install -y r-base
mkdir -p "$R_LIBS_USER" # Create the library path if it doesn't exist
Rscript -e 'install.packages(c("rmarkdown", "jsonlite"), repos="https://cloud.r-project.org")'
- name: Render README.qmd files to README.md
run: |
for file in $(find . -name 'README.qmd'); do
# Render each README.qmd to README.md
quarto render "$file" --to markdown
done
- name: Commit and Push changes
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add **/README.md
git commit -m "Render README.qmd files to README.md"
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}