diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 02f59937..8b589602 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -1,5 +1,5 @@ # Candace Savonen 2021 -# Updated Jan 2023 +# Updated May 2024 name: Pull Request @@ -39,7 +39,7 @@ jobs: branch_name='preview-${{ github.event.pull_request.number }}' echo branch doesnt exist git checkout -b $branch_name || echo branch exists - git push --set-upstream origin $branch_name || echo echo branch exists remotely + git push --set-upstream origin $branch_name || echo branch exists remotely shell: bash @@ -102,13 +102,13 @@ jobs: fetch-depth: 0 - name: Run styler - run: Rscript -e "styler::style_file(list.files(pattern = 'Rmd$', recursive = TRUE, full.names = TRUE));warnings()" + run: Rscript -e "styler::style_file(list.files(pattern = 'md$', recursive = FALSE, full.names = TRUE));warnings()" - name: Commit styled files run: | git config --system --add safe.directory "$GITHUB_WORKSPACE" - git add \*.Rmd - git commit -m 'Style Rmds' || echo "No changes to commit" + git add \*md + git commit -m 'Style *mds' || echo "No changes to commit" git push origin || echo "No changes to commit" ############################# Render Preview ################################### @@ -154,11 +154,21 @@ jobs: # This checks on the steps before it and makes sure that they completed. # If the renders didn't complete we don't want to commit the file changes - - name: Check on render steps - if: steps.bookdown.outcome != 'success' && steps.quarto.outcome != 'success' + - name: Check on Rmd render steps + if: ${{needs.yaml-check.outputs.toggle_website == 'rmd' }} run: | echo Bookdown status ${{steps.bookdown.outcome}} - exit 1 + if [${{steps.bookdown.outcome}} != 'success']; then + exit 1 + fi + + - name: Check on quarto render steps + if: ${{needs.yaml-check.outputs.toggle_website == 'quarto' }} + run: | + echo Quarto status ${{steps.quarto.outcome}} + if [${{steps.quarto.outcome}} != 'success']; then + exit 1 + fi - name: Website preview for download run: zip website-preview.zip docs/* -r diff --git a/.github/workflows/render-all.yml b/.github/workflows/render-all.yml index 8dd7dc44..873357d5 100644 --- a/.github/workflows/render-all.yml +++ b/.github/workflows/render-all.yml @@ -1,5 +1,5 @@ - -# Candace Savonen Apr 2021 +# Candace Savonen 2021 +# Updated May 2024 name: Render all output courses @@ -35,8 +35,8 @@ jobs: rendering_docker_image: "${{ env.RENDERING_DOCKER_IMAGE }}" toggle_quiz_check: "${{ env.CHECK_QUIZZES }}" - render-bookdown: - name: Render bookdown + render-course: + name: Render course preview needs: yaml-check runs-on: ubuntu-latest container: @@ -74,14 +74,24 @@ jobs: # This checks on the steps before it and makes sure that they completed. # If the renders didn't complete we don't want to commit the file changes - - name: Check on render step - if: steps.bookdown.outcome != 'success' + - name: Check on Rmd render steps + if: ${{needs.yaml-check.outputs.toggle_website == 'rmd' }} run: | echo Bookdown status ${{steps.bookdown.outcome}} - exit 1 + if [${{steps.bookdown.outcome}} != 'success']; then + exit 1 + fi + + - name: Check on quarto render steps + if: ${{needs.yaml-check.outputs.toggle_website == 'quarto' }} + run: | + echo Quarto status ${{steps.quarto.outcome}} + if [${{steps.quarto.outcome}} != 'success']; then + exit 1 + fi - # Commit the rendered bookdown files - - name: Commit rendered bookdown files + # Commit the rendered course files + - name: Commit rendered course files env: GH_PAT: ${{ secrets.GH_PAT }} run: | @@ -243,7 +253,7 @@ jobs: id: coursera run: Rscript -e "ottrpal::convert_coursera_quizzes()" - # Commit the rendered bookdown files + # Commit the rendered files # Only commit coursera quizzes if the directory is present - name: Commit rendered Coursera files env: