Skip to content

.github/workflows/build-readme.yaml #178

.github/workflows/build-readme.yaml

.github/workflows/build-readme.yaml #178

Workflow file for this run

# Workflow derived from https://github.com/r-lib/actions/tree/master/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
schedule:
# At 00:00 on Sunday
- cron: "0 0 * * 0"
pull_request:
branches: [main, master]
jobs:
build-readme:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
- uses: r-lib/actions/setup-pandoc@v2
- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true
- uses: r-lib/actions/setup-r-dependencies@v2
- name: Debugging - List Files
run: |
# List the files in the current directory
ls -R profile/
- name: Build Readme
run: Rscript -e 'rmarkdown::render("profile/README.Rmd", output_format = "md_document", output_file = "README.md", output_dir = "profile")'
- name: Debugging - List Files After Rendering
run: |
# List the files after rendering
ls -R profile/
# - name: Commit files
# run: |
# git config --global user.email "[email protected]"
# git config --global user.name "david-nemirovsky"
# git add --all
# git commit -am "chronjob"
# git push origin HEAD:refs/heads/master --force
- name: Commit and push changes
run: |
git config --global user.email "[email protected]"
git config --global user.name "david-nemirovsky"
git add --all
git commit -m "Update README.md"
git push origin HEAD:refs/heads/main --force
- name: Debugging - List Files After Commit
run: |
# List the files after committing
ls -R profile/
# - name: Check File Existence
# run: |
# if [ -f profile/new_readme.md ]; then
# echo "File exists, proceed with renaming."
# else
# echo "File does not exist, check the rendering step."
# exit 1
# fi
# - name: Rename new_readme.md to README.md
# run: mv profile/new_readme.md profile/README.md
# jobs:
# build-readme:
# runs-on: ubuntu-latest
# env:
# GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
# steps:
# - uses: actions/checkout@v2
# - uses: r-lib/actions/setup-pandoc@v2
# - uses: r-lib/actions/setup-r@v2
# with:
# use-public-rspm: true
#
# - uses: r-lib/actions/setup-r-dependencies@v2
#
# - name: Build Readme
# run: Rscript -e 'rmarkdown::render("profile/README.Rmd", output_format = "md_document", output_file = "profile/new_readme.md")'
# - name: Commit files
# run: |
# git config --global user.email "[email protected]"
# git config --global user.name "GitHub Actions User"
# git add --all
# git commit -am "chronjob"
# git push origin HEAD:refs/heads/master --force
#
# - name: Rename new_readme.md to README.md
# run: mv new_readme.md README.md