Skip to content

Commit

Permalink
Update with the changes on fhdsl/ottr
Browse files Browse the repository at this point in the history
  • Loading branch information
cansavvy committed May 15, 2024
1 parent 50cde80 commit e84527c
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 18 deletions.
26 changes: 18 additions & 8 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Candace Savonen 2021
# Updated Jan 2023
# Updated May 2024

name: Pull Request

Expand Down Expand Up @@ -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


Expand Down Expand Up @@ -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 ###################################
Expand Down Expand Up @@ -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
Expand Down
30 changes: 20 additions & 10 deletions .github/workflows/render-all.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

# Candace Savonen Apr 2021
# Candace Savonen 2021
# Updated May 2024

name: Render all output courses

Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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: |
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit e84527c

Please sign in to comment.