Skip to content

Setting up GitHub secrets

Candace Savonen edited this page Sep 18, 2021 · 25 revisions

The Github actions that this repository uses needs four Github secrets set up.

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

See Github Actions section for how you can customize Github actions which can change the necessity of these secrets.

Github secrets

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.

For each new secret, click the New repository secret button and set each as follows, clicking Add secret as you fill each in appropriately:

Name: GH_PAT:
*If you are a part of jhudsl organization you do not need to set these. For value: Create a personal access token following these instructions. Underneath Select scopes, check both repo and workflow. Then copy the PAT and save as the value.

Dockerhub related secrets

Note these are not required if Docker update Github actions are not turned on. *If you are a part of jhudsl organization you do not need to set these.

Name: DOCKERHUB_USERNAME:
For value: put your login username for https://hub.docker.com/

Name: DOCKERHUB_TOKEN:
For value: put a access token for Dockerhub. You can create this by following these instructions.

Google Slide related secrets

Note these steps are not required if Google slide update Github actions are not turned on.

Before following these steps, you'll need to set up the Google slides following the instructions here.

To set up Google Slides Github Actions, you'll need to do some set up, but you will only have to do this once.

You'll need three secrets and you'll need to run some steps in your local R/RStudio outside of Docker to get some of them.

Install the package, rgoogleslides if you have not before.

install.packages("rgoogleslides")

Then, run the following: It will open up a browser and ask you to sign in

token <- rgoogleslides::authorize()

There are two tokens you'll need, an ACCESS token and a REFRESH token. Once you've run the above steps you can get these tokens by running for the ACCESS token:

token$credentials$access_token

and for the REFRESH token:

token$credentials$refresh_token

Now to set up these as Github secrets, on your repository's main Github page, go to Settings and scroll down to see Secrets on the left side menu bar. Click the New repository secret button and set each as follows, clicking Add secret as you fill each in appropriately:

Name: GOOGLE_SLIDE_ACCESS_TOKEN:
For value: paste the output from token$credentials$access_token from the steps above.

Name: GOOGLE_SLIDE_REFRESH_TOKEN:
For value: paste the output from token$credentials$access_token from the steps above.

Lastly, set your Google Slide ID:

Name: GOOGLE_SLIDE_ID:
For value: set the presentation ID of your main Google Slides for this course. Set up the Google slides following the instructions here. The is in the URL of your Google Slide:

https://docs.google.com/presentation/d/<presentationId>/edit

Once you click Save for all of these, you should be all set.

Clone this wiki locally