Skip to content

Commit

Permalink
Add styler to render all workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
avahoffman committed Jun 9, 2022
1 parent 2ce313a commit e24bf2d
Showing 1 changed file with 30 additions and 4 deletions.
34 changes: 30 additions & 4 deletions .github/workflows/render-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,41 @@ jobs:
with:
files: config_automation.yml # Pass a space-separated list of configuration files. Rightmost files take precedence.
outputs:
toggle_style_code: "${{ env.STYLE_CODE }}"
toggle_bookdown: "${{ env.RENDER_BOOKDOWN }}"
toggle_coursera: "${{ env.RENDER_COURSERA }}"
toggle_leanpub: "${{ env.RENDER_LEANPUB }}"
rendering_docker_image: "${{ env.RENDERING_DOCKER_IMAGE }}"
toggle_quiz_check: "${{ env.CHECK_QUIZZES }}"

style-code:
name: Style code
needs: yaml-check
runs-on: ubuntu-latest
if: ${{needs.yaml-check.outputs.toggle_style_code == 'yes'}}
container:
image: jhudsl/course_template:main

steps:
- name: Checkout files
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Run styler
run: Rscript -e "styler::style_file(list.files(pattern = 'Rmd$', recursive = TRUE, full.names = TRUE));warnings()"

- name: Commit styled files
run: |
git config --local user.email "itcrtrainingnetwork@gmail.com"
git config --local user.name "jhudsl-robot"
git add \*.Rmd
git commit -m 'Style Rmds' || echo "No changes to commit"
git push origin || echo "No changes to commit"
render-bookdown:
name: Render bookdown
needs: yaml-check
needs: [yaml-check, style-code]
runs-on: ubuntu-latest
container:
image: ${{needs.yaml-check.outputs.rendering_docker_image}}
Expand Down Expand Up @@ -85,7 +111,7 @@ jobs:
render-tocless:
name: Render TOC-less version for Leanpub or Coursera
needs: [yaml-check]
needs: [yaml-check, style-code]
runs-on: ubuntu-latest
container:
image: ${{needs.yaml-check.outputs.rendering_docker_image}}
Expand Down Expand Up @@ -122,7 +148,7 @@ jobs:
render-leanpub:
name: Finish Leanpub prep
needs: [yaml-check, render-tocless]
needs: [yaml-check, style-code, render-tocless]
runs-on: ubuntu-latest
container:
image: jhudsl/ottrpal:main
Expand Down Expand Up @@ -187,7 +213,7 @@ jobs:
render-coursera:
name: Finish Coursera prep
needs: [yaml-check, render-tocless]
needs: [yaml-check, style-code, render-tocless]
runs-on: ubuntu-latest
container:
image: ${{needs.yaml-check.outputs.rendering_docker_image}}
Expand Down

0 comments on commit e24bf2d

Please sign in to comment.