Skip to content

Commit

Permalink
Merge pull request #66 from jhudsl/51-file-automatic-issues
Browse files Browse the repository at this point in the history
File automatic issues using GHA
  • Loading branch information
cansavvy authored Aug 21, 2024
2 parents ced3af3 + c225350 commit 22194ff
Show file tree
Hide file tree
Showing 6 changed files with 120 additions and 0 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.
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
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

0 comments on commit 22194ff

Please sign in to comment.