Update README.qmd #21
Workflow file for this run
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
name: Render README.qmd to Markdown | |
on: | |
push: | |
branches: | |
- stage | |
jobs: | |
render: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
persist-credentials: false | |
- name: Set up R | |
uses: r-lib/actions/setup-r@v2 | |
- name: Install Required R Packages | |
run: | | |
Rscript -e 'if (!requireNamespace("rmarkdown", quietly = TRUE)) install.packages("rmarkdown", repos = "https://cloud.r-project.org/")' | |
Rscript -e 'if (!requireNamespace("knitr", quietly = TRUE)) install.packages("knitr", repos = "https://cloud.r-project.org/")' | |
- name: Set up Quarto | |
uses: quarto-dev/quarto-actions/setup@v2 | |
- name: Find and Render README.qmd Files | |
run: | | |
find . -name "README.qmd" | while read qmd_file; do | |
quarto render "$qmd_file" --to markdown | |
# rmarkdown::render(qmd_file) | |
done | |
- name: Commit and Push Rendered Files | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
git config --local user.name "$GITHUB_ACTOR" | |
git config --local user.email "[email protected]" | |
git add . | |
git commit -m "Render README.qmd files to Markdown [skip ci]" || echo "No changes to commit" | |
git fetch origin | |
git checkout stage || git checkout -b stage | |
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git | |
git push origin stage |