another two #21
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
on: | |
push: | |
branches: [ main ] | |
workflow_run: | |
workflows: ["CI release"] | |
types: | |
- completed | |
name: build docs | |
jobs: | |
run_commands: | |
runs-on: ubuntu-latest | |
env: | |
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
R_KEEP_PKG_SOURCE: yes | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- name: Set up Quarto | |
uses: quarto-dev/quarto-actions/setup@v2 | |
- name: Set up Pandoc | |
uses: r-lib/actions/setup-pandoc@v2 | |
- name: Set up R | |
uses: r-lib/actions/setup-r@v2 | |
with: | |
use-public-rspm: true | |
- name: Set up R dependencies | |
uses: r-lib/actions/setup-r-dependencies@v2 | |
with: | |
working-directory: ./rdocs | |
extra-packages: local::. | |
- name: build documentation | |
run: | | |
rdocs::generate_docs(files = "./rdocs/R/main.R", folder_name = "docs", gh_url = "https://github.com/daniellga/rdocs/tree/main/rdocs/R", run_examples = FALSE) | |
shell: Rscript {0} | |
- name: Check for changes | |
id: check_changes | |
run: | | |
pwd | |
ls | |
git add . | |
git diff --exit-code || echo "Git has changes." | |
if [ $? -eq 0 ]; then | |
echo "No changes to commit." | |
exit 0 | |
fi | |
- name: Commit and push changes | |
if: steps.check_changes.outputs['exit-code'] != '0' | |
run: | | |
git config --global user.email "${GITHUB_ACTOR_ID}+${GITHUB_ACTOR}@users.noreply.github.com" | |
git config --global user.name "${GITHUB_ACTOR}" | |
git commit -m "Created github pages docs" | |
git push origin master | |