Skip to content

Commit

Permalink
add template sync action to repo (#146)
Browse files Browse the repository at this point in the history
* add template sync action to repo

* add files to sync ignore

* update checkout actions to v3

---------

Co-authored-by: Joachim Meyer <[email protected]>
  • Loading branch information
JessicaS11 and jomey authored Mar 1, 2024
1 parent 63af51a commit 71922e3
Show file tree
Hide file tree
Showing 9 changed files with 63 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
},
{
"login": "JessicaS11",
"name": "Jessica",
"name": "Jessica Scheick",
"avatar_url": "https://avatars.githubusercontent.com/u/11756442?v=4",
"profile": "https://github.com/JessicaS11",
"contributions": [
Expand Down
11 changes: 9 additions & 2 deletions .github/actions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ The `workflows/` subfolder contains continuous integration workflows
#### [binder-badge.yaml](../workflows/binder-badge.yaml)
Create [binder](https://mybinder.readthedocs.io/en/latest/howto/gh-actions-badges.html) badges with links to test tutorial notebooks

#### [build-website.yaml](../workflows/build-website.yaml)
Build the websites (JupyterBook and front page). Run on Pull Requests against every commit and via a 'cron' schedule to maintain caching [since otherwise the cache expires if untouched in 7 days](https://docs.github.com/en/actions/advanced-guides/caching-dependencies-to-speed-up-workflows#usage-limits-and-eviction-policy)

#### [deploy.yaml](../workflows/deploy.yaml)
Render and publish the websites (JupyterBook and landing page) to GitHub Pages

Expand All @@ -35,8 +38,12 @@ Quality assessment and quality control. Standardizes formatting including spell
#### [repo2docker.yaml](../workflows/repo2docker.yaml)
[Build a Docker image](https://github.com/jupyterhub/repo2docker-action) for JupyterHub/BinderHub

#### [test.yaml](../workflows/test.yaml)
Build the websites (JupyterBook and front page). Run on Pull Requests against every commit and via a 'cron' schedule to maintain caching [since otherwise the cache expires if untouched in 7 days](https://docs.github.com/en/actions/advanced-guides/caching-dependencies-to-speed-up-workflows#usage-limits-and-eviction-policy)
#### [template-sync.yaml](../workflows/template-sync.yaml)
Open a PR to update the templated repo to incorporate changes made to the
[template repo](https://github.com/uwhackweek/jupyterbook-template).
Template users should fill out the [.templatesyncignore](../../../.templatesyncignore)
to specify which files they do not want updated from the template.


## Security

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/binder-badge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Checkout PR
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: cache binder build on mybinder.org
uses: jupyterhub/repo2docker-action@master
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/manual.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Configure NASA Earthdata Login
continue-on-error: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/repo2docker-PR.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Checkout Repo
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Get CalenderVersion UTC Date
id: calver
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/repo2docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Checkout Repo
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Get CalenderVersion UTC Date
id: calver
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/template-sync.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: 'Sync to Template'
description: 'Get updates to the Jupyterbook from the template repo'

on:
# cronjob trigger (minute, hour, day, month, day-of-week; here 1st of month)
# schedule:
# - cron: "0 0 1 * *"
# manual trigger
workflow_dispatch:

jobs:
repo-sync:
runs-on: ubuntu-latest
# https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs
permissions:
contents: write
pull-requests: write

steps:
# To use this repository's private action, you must check out the repository
- name: Checkout
uses: actions/checkout@v4
# https://github.com/actions/checkout#usage
# uncomment if you use submodules within the source repository
# with:
# submodules: true

- name: actions-template-sync
uses: AndreasAugustin/actions-template-sync@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
source_repo_path: uwhackweek/jupyterbook-template
upstream_branch: main # defaults to main
15 changes: 15 additions & 0 deletions .templatesyncignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# THIS FILE CANNOT BE SYNCED
# use glob patterns as in .gitignore
# recommend listing non-basics tutorial directories here

# configuration files
cookiecutter.yaml

# environment lock files
./conda/*lock.yml

# book files (configuration, usage-specific)
./book/_config.yml
./book/team.yaml

# event-specific tutorials
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ We've found that every hackweek benefits from a single-page website to get peopl

We've used this template for the following events:

* ICESat-2 Hackweek 2022: https://icesat-2.hackweek.io
* ICESat-2 Hackweek 2022 + 2023: https://icesat-2.hackweek.io
* SnowEx Hackweek 2021: https://snowex-hackweek.github.io/website/intro.html


Expand Down

0 comments on commit 71922e3

Please sign in to comment.