From 0c1a6accb67ca9c0f629166bf0b97228ce0b62d5 Mon Sep 17 00:00:00 2001
From: Kate Isaac <41767733+kweav@users.noreply.github.com>
Date: Thu, 15 Aug 2024 12:36:58 -0400
Subject: [PATCH 1/5] Update customize-docker.Rmd test workflow URL
---
customize-docker.Rmd | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/customize-docker.Rmd b/customize-docker.Rmd
index 72b1b79..4599d92 100644
--- a/customize-docker.Rmd
+++ b/customize-docker.Rmd
@@ -205,7 +205,7 @@ For your personalized docker image, you can store the Dockerfile anywhere. In or
It may be easiest to store it in the OTTR-made repository you are working from.
-In whichever repository you choose to store your Dockerfile, its recommended you use a GitHub action to automatically test it when you make changes. You can use our Docker handling [GitHub action here as a starting point](https://github.com/jhudsl/OTTR_Template/blob/main/.github/workflows/docker-test.yml).
+In whichever repository you choose to store your Dockerfile, its recommended you use a GitHub action to automatically test it when you make changes. You can use our Docker handling [GitHub action here as a starting point](https://github.com/jhudsl/ottr-docker/blob/main/.github/workflows/docker-test.yml).
You will need to modify this GHA for your own purposes:
From 11ef6a8bcdbd113f25387a1a20cf264c2408a01f Mon Sep 17 00:00:00 2001
From: GitHub Actions In whichever repository you choose to store your Dockerfile, its
recommended you use a GitHub action to automatically test it when you
make changes. You can use our Docker handling GitHub
+href="https://github.com/jhudsl/ottr-docker/blob/main/.github/workflows/docker-test.yml">GitHub
action here as a starting point. You will need to modify this GHA for your own purposes:Github actions for handling your Docker image
diff --git a/docs/customize-style.html b/docs/customize-style.html
index 7da889a..22a30d8 100644
--- a/docs/customize-style.html
+++ b/docs/customize-style.html
@@ -614,7 +614,7 @@
Changing the favicon
will be used.
---
title: "Course Name "
-date: "July, 2024"
+date: "September, 2024"
site: bookdown::bookdown_site
documentclass: book
bibliography: [book.bib, packages.bib]
From ef65df5f76a25dd062c5edd89df93b6eb0d3bdd3 Mon Sep 17 00:00:00 2001
From: cansavvy
Date: Fri, 6 Sep 2024 18:28:35 +0000
Subject: [PATCH 3/5] =?UTF-8?q?=F0=9F=94=84=20Synced=20local=20'.github/wo?=
=?UTF-8?q?rkflows/'=20with=20remote=20'.github/workflows/'?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
test-run
---
.github/workflows/delete-preview.yml | 2 +-
.github/workflows/docker-test.yml | 4 +-
.github/workflows/file-automatic-issues.yml | 43 +++++++++++++++
.github/workflows/pull_request.yml | 59 ++++++++++++---------
.github/workflows/render-site.yml | 19 +++----
5 files changed, 91 insertions(+), 36 deletions(-)
create mode 100644 .github/workflows/file-automatic-issues.yml
diff --git a/.github/workflows/delete-preview.yml b/.github/workflows/delete-preview.yml
index afd658a..faa83cc 100644
--- a/.github/workflows/delete-preview.yml
+++ b/.github/workflows/delete-preview.yml
@@ -18,7 +18,7 @@ jobs:
# Check out current repository
- name: checkout
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
with:
fetch-depth: 0
diff --git a/.github/workflows/docker-test.yml b/.github/workflows/docker-test.yml
index 6d786f4..b1cdc47 100644
--- a/.github/workflows/docker-test.yml
+++ b/.github/workflows/docker-test.yml
@@ -33,10 +33,10 @@ jobs:
steps:
- name: checkout repo
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
- name: Verify Dockerfiles changed?
- uses: tj-actions/verify-changed-files@v8.8
+ uses: tj-actions/verify-changed-files@v17
id: verify-changed-files
with:
files: |
diff --git a/.github/workflows/file-automatic-issues.yml b/.github/workflows/file-automatic-issues.yml
new file mode 100644
index 0000000..e24658d
--- /dev/null
+++ b/.github/workflows/file-automatic-issues.yml
@@ -0,0 +1,43 @@
+# Code adapted from https://github.com/JetBrains/intellij-platform-plugin-template/blob/deb171483598ee8a5d7621154db880e87b4db4ef/.github/workflows/template-cleanup.yml
+# by Candace Savonen for this repository.
+
+name: Starting a website
+
+on:
+ push:
+ branches: [ main, staging ]
+ workflow_dispatch:
+
+jobs:
+ # Run cleaning process only if workflow is triggered by not being in the Bookdown template anymore
+ template-cleanup:
+ name: Template Cleanup
+ runs-on: ubuntu-latest
+ if: github.event.repository.name != 'OTTR_Template_Website'
+ steps:
+ - name: checkout repo
+ uses: actions/checkout@v4
+
+ # Issue for what repository settings need to be set
+ - name: New Course - Set Repository Settings
+ uses: peter-evans/create-issue-from-file@v4
+ with:
+ title: New Course - Set Repository Settings
+ content-filepath: .github/automatic-issues/set-repo-settings.md
+ labels: automated training issue
+
+ # Issue for what needs to be edited
+ - name: New Course - Templates to Edit
+ uses: peter-evans/create-issue-from-file@v4
+ with:
+ title: New Course - Templates to Edit
+ content-filepath: .github/automatic-issues/templates-to-edit.md
+ labels: automated training issue
+
+ # Issue for how to enroll repo for updates
+ - name: New Course - Template Update Enrollment
+ uses: peter-evans/create-issue-from-file@v4
+ with:
+ title: New Course - Template Update Enrollment
+ content-filepath: .github/automatic-issues/update-enrollment.md
+ labels: automated training issue
diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml
index 0fa603b..70a1eab 100644
--- a/.github/workflows/pull_request.yml
+++ b/.github/workflows/pull_request.yml
@@ -1,5 +1,5 @@
# Candace Savonen Dec 2021
-# Updated April 2023
+# Updated Aug 2024
name: Pull Request
on:
@@ -13,9 +13,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
with:
fetch-depth: 0
+ token: ${{ secrets.GH_PAT }}
# Use the yaml-env-action action.
- name: Load environment from YAML
@@ -25,17 +26,19 @@ jobs:
# Delete the branch if this has been run before
- name: Delete branch locally and remotely
- run: git push origin --delete preview-${{ github.event.pull_request.number }} || echo "No branch to delete"
+ run: git push --force origin --delete preview-${{ github.event.pull_request.number }} || echo "No branch to delete"
# Make the branch fresh
- name: Make the branch fresh
run: |
- git config --local user.email "itcrtrainingnetwork@gmail.com"
- git config --local user.name "jhudsl-robot"
+ git config --global --add safe.directory $GITHUB_WORKSPACE
+ git config --global user.name 'github-actions[bot]'
+ git config --global user.email 'github-actions[bot]@users.noreply.github.com'
+
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
+ git push --force --set-upstream origin $branch_name
shell: bash
outputs:
@@ -71,21 +74,21 @@ jobs:
needs: yaml-check
runs-on: ubuntu-latest
container:
- image: jhudsl/course_template:main
+ image: ${{needs.yaml-check.outputs.rendering_docker_image}}
if: ${{needs.yaml-check.outputs.toggle_render_preview == 'yes'}}
steps:
- name: Checkout files
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
with:
fetch-depth: 0
# Set up git checkout
- name: Set up git checkout
run: |
- git config --system --add safe.directory $GITHUB_WORKSPACE
- git config --local user.email "itcrtrainingnetwork@gmail.com"
- git config --local user.name "jhudsl-robot"
+ git config --global --add safe.directory $GITHUB_WORKSPACE
+ git config --global user.name 'github-actions[bot]'
+ git config --global user.email 'github-actions[bot]@users.noreply.github.com'
branch_name='preview-${{ github.event.pull_request.number }}'
git fetch --all
@@ -110,21 +113,24 @@ jobs:
echo site status ${{steps.site.outcome}}
exit 1
- # Commit the rendered website files
- - name: Commit rendered website files to preview branch
+ - name: Website preview for download
+ run: zip website-preview.zip docs/* -r
+
+ # Commit the website files
+ - name: Commit rendered website files
id: commit
run: |
branch_name='preview-${{ github.event.pull_request.number }}'
- git diff origin/main -- '*.html' >/dev/null && changes=true || changes=false
- echo ::set-output name=changes::$changes
+ git diff origin/main -- docs >/dev/null && changes=true || changes=false
+ echo "changes=$changes" >> $GITHUB_OUTPUT
git add . --force
git commit -m 'Render preview' || echo "No changes to commit"
- git pull --set-upstream origin $branch_name --allow-unrelated-histories --strategy-option=ours
+ git pull --rebase --set-upstream origin $branch_name --allow-unrelated-histories --strategy-option=ours
git push --force || echo "No changes to commit"
shell: bash
- name: Find Comment
- uses: peter-evans/find-comment@v1
+ uses: peter-evans/find-comment@v3
id: fc
with:
issue-number: ${{ github.event.pull_request.number }}
@@ -136,26 +142,31 @@ jobs:
run: |
course_name=$(head -n 1 _website.yml | cut -d'"' -f 2| tr " " "-")
website_link=$(echo "https://htmlpreview.github.io/?https://raw.githubusercontent.com/$GITHUB_REPOSITORY/preview-${{ github.event.pull_request.number }}/docs/index.html")
- echo ::set-output name=website_link::$website_link
- echo ::set-output name=time::$(date +'%Y-%m-%d')
- echo ::set-output name=commit_id::$GITHUB_SHA
+ docs_link=$(echo "https://github.com/$GITHUB_REPOSITORY/raw/preview-${{ github.event.pull_request.number }}/website-preview.zip")
+ echo "zip_link=$docs_link" >> $GITHUB_OUTPUT
+ echo "website_link=$website_link" >> $GITHUB_OUTPUT
+ echo "time=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
+ echo "commit_id=$GITHUB_SHA" >> $GITHUB_OUTPUT
echo ${{steps.commit.outputs.changes}}
- name: Create or update comment
if: steps.commit.outputs.changes == 'true'
- uses: peter-evans/create-or-update-comment@v1
+ uses: peter-evans/create-or-update-comment@v3
with:
comment-id: ${{ steps.fc.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
body: |
- Re-rendered previews from the latest commit: See [preview of website here](${{ steps.build-components.outputs.website_link }})
+ :eyes: Quick [preview of website here](${{ steps.build-components.outputs.website_link }}) \*
+ :microscope: Comprehensive [download of the website here](${{ steps.build-components.outputs.zip_link }})
- _Updated at ${{ steps.build-components.outputs.time }} with changes from ${{ steps.build-components.outputs.commit_id }}_
+ \* note not all html features will be properly displayed in the "quick preview" but it will give you a rough idea.
+
+ _Updated at ${{ steps.build-components.outputs.time }} with changes from the latest commit ${{ steps.build-components.outputs.commit_id }}_
edit-mode: replace
- name: No comment if no changes
if: steps.commit.outputs.changes == 'false'
- uses: peter-evans/create-or-update-comment@v1
+ uses: peter-evans/create-or-update-comment@v3
with:
comment-id: ${{ steps.fc.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
diff --git a/.github/workflows/render-site.yml b/.github/workflows/render-site.yml
index 508c0b1..d5d6415 100644
--- a/.github/workflows/render-site.yml
+++ b/.github/workflows/render-site.yml
@@ -15,10 +15,8 @@ on:
- '**.Rmd'
- styles.css
- _site.yml
- - subdir_html/*.Rmd
- resources/images/*.png
- resources/images/favicon.ico
- - site_libs/*
jobs:
yaml-check:
@@ -26,7 +24,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
# Use the yaml-env-action action.
- name: Load environment from YAML
@@ -43,11 +41,11 @@ jobs:
runs-on: ubuntu-latest
container:
image: ${{needs.yaml-check.outputs.rendering_docker_image}}
- # Steps represent a sequence of tasks that will be executed as part of the job
- steps:
+
+ steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: checkout
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
with:
# get the full repo
fetch-depth: 0
@@ -72,11 +70,14 @@ jobs:
exit 1
# Commit the rendered site files - html files and site_libs files
+# The git reset step will remove any other files created in this workflow, such as API keys
- name: Commit rendered site files
run: |
- git config --system --add safe.directory $GITHUB_WORKSPACE
- git config --local user.email "actions@github.com"
- git config --local user.name "GitHub Actions"
+ git config --global --add safe.directory $GITHUB_WORKSPACE
+ git config --global user.name 'github-actions[bot]'
+ git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add --force docs/*
git commit -m 'Render site' || echo "No changes to commit"
+ git reset --hard HEAD
+ git pull --rebase --allow-unrelated-histories --strategy-option=ours
git push origin main || echo "No changes to push"
From c329e0e0640fdf726daf7648c1395ee65dd06b1f Mon Sep 17 00:00:00 2001
From: cansavvy
Date: Fri, 6 Sep 2024 18:28:36 +0000
Subject: [PATCH 4/5] =?UTF-8?q?=F0=9F=94=84=20Synced=20local=20'config=5Fa?=
=?UTF-8?q?utomation.yml'=20with=20remote=20'config=5Fautomation.yml'?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
test-run
---
config_automation.yml | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/config_automation.yml b/config_automation.yml
index 12d9dd0..1a1a577 100644
--- a/config_automation.yml
+++ b/config_automation.yml
@@ -12,6 +12,8 @@ spell-check: yes
style-code: yes
# Test build the docker image if any docker-relevant files have been changed
docker-test: no
+# Should URLs be tested periodically?
+url-check-periodically: yes
##### Renderings run upon merge to main branch #####
# Rendering each platform's content
@@ -19,6 +21,10 @@ render-bookdown: yes
render-leanpub: yes
render-coursera: no
+## Automate the creation of Book.txt file? TRUE/FALSE?
+## This is only relevant if render-leanpub is yes, otherwise it will be ignored
+make-book-txt: TRUE
+
# What docker image should be used for rendering?
# The default is jhudsl/base_ottr:main
rendering-docker-image: 'jhudsl/base_ottr:main'
From ca7b9769f9b821134d9d6140fe857895eebe18c2 Mon Sep 17 00:00:00 2001
From: Carrie Wright <23014755+carriewright11@users.noreply.github.com>
Date: Fri, 6 Sep 2024 14:46:52 -0400
Subject: [PATCH 5/5] Update .github/workflows/file-automatic-issues.yml
---
.github/workflows/file-automatic-issues.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/file-automatic-issues.yml b/.github/workflows/file-automatic-issues.yml
index e24658d..55f5baa 100644
--- a/.github/workflows/file-automatic-issues.yml
+++ b/.github/workflows/file-automatic-issues.yml
@@ -1,7 +1,7 @@
# Code adapted from https://github.com/JetBrains/intellij-platform-plugin-template/blob/deb171483598ee8a5d7621154db880e87b4db4ef/.github/workflows/template-cleanup.yml
# by Candace Savonen for this repository.
-name: Starting a website
+name: Starting a Website
on:
push: