forked from jmunroe/spyglass-demo
-
Notifications
You must be signed in to change notification settings - Fork 1
40 lines (32 loc) · 1 KB
/
sync-notebooks.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
name: Sync Notebooks Folder
on:
schedule:
- cron: '0 0 * * 0' # Runs at 00:00 every Sunday
workflow_dispatch:
jobs:
sync-notebooks:
runs-on: ubuntu-latest
steps:
- name: Checkout destination repository
uses: actions/checkout@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0 # Fetch all history for all branches and tags
- name: Install rsync
run: sudo apt-get install rsync
- name: Rsync notebooks
run: |
git clone https://github.com/LorenFrankLab/spyglass.git tmp --depth=1
rsync -av --exclude='.git/' tmp/notebooks/ ./notebooks/
- name: Configure git
run: |
git config user.name "GitHub Actions"
git config user.email "[email protected]"
- name: Commit changes
run: |
git add notebooks/
git diff --staged --quiet || git commit -m "Sync notebooks"
- name: Pull with rebase
run: git pull --rebase
- name: Push changes
run: git push origin HEAD:main