-
Notifications
You must be signed in to change notification settings - Fork 1
49 lines (44 loc) · 1.52 KB
/
sync.yml
File metadata and controls
49 lines (44 loc) · 1.52 KB
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
41
42
43
44
45
46
47
48
49
name: Sync
on:
push:
branches:
- main
jobs:
private-to-public:
if: github.repository == 'PalamaraLab/quickdraws_dev'
runs-on: ubuntu-latest
steps:
- name: Checkout private repo
uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- name: Mirror main to public repo
run: |
remote_repo="https://fcooper8472:${{ secrets.DEPLOY_ACCESS_TOKEN }}@github.com/PalamaraLab/quickdraws.git"
git fetch "${remote_repo}" main
if ! git diff --quiet HEAD FETCH_HEAD; then
git push "${remote_repo}" HEAD:main --follow-tags --force
echo "Changes detected and pushed to public repo."
else
echo "No changes detected. No push needed."
fi
public-to-private:
if: github.repository == 'PalamaraLab/quickdraws'
runs-on: ubuntu-latest
steps:
- name: Checkout public repo
uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- name: Mirror main to private repo
run: |
remote_repo="https://fcooper8472:${{ secrets.DEPLOY_ACCESS_TOKEN }}@github.com/PalamaraLab/quickdraws_dev.git"
git fetch "${remote_repo}" main
if ! git diff --quiet HEAD FETCH_HEAD; then
git push "${remote_repo}" HEAD:main --follow-tags --force
echo "Changes detected and pushed to private repo."
else
echo "No changes detected. No push needed."
fi