Skip to content

Commit

Permalink
Merge branch 'main' into cansavvy/buggs
Browse files Browse the repository at this point in the history
  • Loading branch information
cansavvy authored Aug 21, 2024
2 parents c2a53b7 + 22194ff commit 326ee90
Show file tree
Hide file tree
Showing 15 changed files with 147 additions and 6 deletions.
14 changes: 14 additions & 0 deletions .github/automatic-issues/git-secrets.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

**Note these steps are only pertinent if you are setting up this website outside of the jhudsl organization**

For more information on these settings see instructions in the [getting started on ottrproject.org](https://www.ottrproject.org/getting_started.html#6_Set_up_your_GitHub_personal_access_token).

It's important that these are set up and named exactly what they are below in order for Github actions to work correctly.

To set up these repository secrets, on your repository's main Github page, go to `Settings` and scroll down to see `Secrets` on the left side menu bar.

- [ ] Set `GH_PAT`
`Name`: `GH_PAT`
`value`: A personal access token [following these instructions](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token#creating-a-token).
Underneath `Select scopes`, check both `repo` and `workflow`.
Then copy the PAT and save as the value.
23 changes: 23 additions & 0 deletions .github/automatic-issues/set-repo-settings.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@

For more information on these settings see instructions in [Starting a new OTTR website](https://www.ottrproject.org/getting_started.html#starting-a-new-ottr-course).

- [ ] This website repository is set to `public`.

- [ ] [Github secret `GH_PAT` has been set](https://www.ottrproject.org/getting_started.html#6_Set_up_your_GitHub_personal_access_token)
`Name`: `GH_PAT`
`value`: A personal access token [following these instructions](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token#creating-a-token).
Underneath `Select scopes`, check both `repo` and `workflow`.
Then copy the PAT and save as the value.

- [ ] GitHub pages is turned on
- [ ] Go to `Settings` > `Pages`. Underneath `Source`, choose `main` for the branch and select the `docs` folder. Then click `Save`.
- [ ] Check `Enforce HTTPS`.

- [ ] [Set branch protections settings](https://www.ottrproject.org/getting_started.html#8_Set_up_branch_rules)
- [ ] `main` branch has been set up:
- [ ] `Require pull request reviews before merging` box is checked.
- [ ] `Require status checks to pass before merging` box is checked.
- [ ] Underneath that `Require branches to be up to date before merging` box is checked.
- [ ] Click `Save` at the bottom of the page!

- [ ] [Customize GitHub actions](https://www.ottrproject.org/customize-robots.html) for what you will need in this website.
32 changes: 32 additions & 0 deletions .github/automatic-issues/templates-to-edit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@

[Follow the instructions here in ottrproject.org](https://www.ottrproject.org/editing_website.html) for details on how to start editing your OTTR website.

The following files need to be edited to get this new website started!

### Files that need edited upon creating a new website.

- [ ] `README.md` - Fill in the README with the title of the website, a brief description of the website, and any other details that would be useful for anyone who encounters your website.
- [ ] `index.Rmd` - Update the `title` field. Since this Rmd file serves as the website's landing page, include any information you believe will be beneficial for visitors upon their arrival.


### Files that need to be edited upon adding each new page.

- [ ] `_site.yml` - Include the title of your newly created page in the `text` field, and insert the corresponding html file name into the `href` field.

### Picking a style

See more [about customizing style on this page in the guide](https://www.ottrproject.org/customize-style.html).
By default this website template will use the jhudsl data science lab style. However, you can customize and switch this to another style set.

#### Using a style set

[Read more about the style sets here](https://www.ottrproject.org/customize-style.html#Using_a_style_set).

- [ ] On a new branch, copy the `style-sets/<set-name>/index.Rmd` and `style-sets/<set-name>/_output.yml` to the top of the repository to overwrite the default `index.Rmd` and `_output.yml`.
- [ ] Copy over all the files in the `style-sets/<set-name>/copy-to-assets` to the `assets` folder in the top of the repository.
- [ ] [Create a pull request](https://www.ottrproject.org/writing_content.html#Open_a_pull_request) with these changes, and double check the rendered preview to make sure that the style is what you are looking for.

### Files that need to be edited upon adding new packages that the book's code uses:

- `docker/Dockerfile` needs to have the new package added so it will be installed. See [instructions](https://www.ottrproject.org/customize-docker.html).
- The code chunk in `index.Rmd` should be edited to add the new package.
7 changes: 7 additions & 0 deletions .github/automatic-issues/update-enrollment.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

The original template: https://github.com/jhudsl/OTTR_Template_Website is always a work in progress.
We are working on adding more features and smoothing out bugs as we go.

If you want to receive updates from the original template to your website template, you will need to enroll this repository to the template updates by adding it to the `sync.yml` file.

- [ ] [Follow these instructions](https://www.ottrproject.org/getting_started.html#9_Enroll_your_repository_for_OTTR_updates) to enroll your website repository to receive these updates.
10 changes: 7 additions & 3 deletions .github/sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ group:
dest: config_automation.yml
# Repositories to receive changes
repos: |
jhudsl/ottr-website
jhudsl/ottrproject.org
jhudsl/Baltimore_Community_Course
maculatus/test-ottr-website
dr-sayyadhury/OTTR_Template_Website_repo
Expand All @@ -30,8 +30,12 @@ group:
buriedsand/glbio-personal-website
PurplFeesh/test-ottr-site
jcha40/ottr_test_site
jhudsl/ITCR_Tables
fhdsl/ITN_search
jhudsl/ITN_computing_resources
fhdsl/ITN_course_search
cansavvy/cansavvy_website
fhdsl/metricminer-dashboard
fhdsl/Intermediate_R
fhdsl/AnVIL_Poll_2024
###ADD NEW REPO HERE following the format above#

### These are custom groups for syncing -- not all files needs to be synced # will update later
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
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: |
Expand Down
43 changes: 43 additions & 0 deletions .github/workflows/file-automatic-issues.yml
Original file line number Diff line number Diff line change
@@ -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
5 changes: 4 additions & 1 deletion .github/workflows/render-site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,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 --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 push --force origin main || echo "No changes to push"
git reset --hard HEAD
git pull --rebase --allow-unrelated-histories --strategy-option=ours
git push origin main || echo "No changes to push"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
.Rhistory
.RData
.Ruserdata
.DS_Store
File renamed without changes.
6 changes: 6 additions & 0 deletions config_automation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,19 @@ 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
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'
2 changes: 2 additions & 0 deletions docs/check_reports/spell_check_results.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
word file lines
ottrproject README.md 3
2 changes: 2 additions & 0 deletions docs/check_reports/url_checks.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
urls urls_status file
https://www.ottrproject.org/writing_content.html failed /github/workspace/editing.Rmd
2 changes: 1 addition & 1 deletion docs/editing.html
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ <h1 class="title toc-ignore">Editing</h1>

<p>Now that your website is alive and hosted, how do you start customizing it to have your content?</p>
<p>If you already know how to file pull requests, feel free to start making edits as you see fit using some of the structure points we’ve noted below.</p>
<p>If you are not familiar with pull requests, <a href="https://www.ottrproject.org/writing_content.html">read this guide to get started</a>.</p>
<p>If you are not familiar with pull requests, <a href="https://www.ottrproject.org/editing_website.html">read this guide to get started</a>.</p>
<div id="title" class="section level2">
<h2>Title</h2>
<p>To change the title of the website, modify the <code>name</code> line of the <code>_site.yml</code> file.</p>
Expand Down
4 changes: 4 additions & 0 deletions resources/dictionary.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,16 @@ GH
Github
GitHub
HTTPS
ITN
ITCR
lightblue
lightgreen
OTTR
Rmd
repo
subdir
th
tibble
www
automations
Bootstap
Expand Down

0 comments on commit 326ee90

Please sign in to comment.