Skip to content

Commit 78ec479

Browse files
Add github action to sync with public repo (#15)
This PR adds a github action workflow that automatically syncs the internal with the public repository. I've already rebased the internal repo to include all the current commits from the public repo. This makes a push with --force, so all changes on the public main that aren't done in the main are overwritten! Base64 decoded private key is already added to the github actions secrets.
1 parent bf27527 commit 78ec479

1 file changed

Lines changed: 37 additions & 0 deletions

File tree

.github/workflows/sync.yaml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Sync to Public Repo
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
types:
11+
- closed
12+
13+
jobs:
14+
sync:
15+
runs-on: ubuntu-latest
16+
17+
if: ${{ github.repository == 'NX-AI/xlstm-internal' }}
18+
env:
19+
DESTINATION_URL: git@github.com:NX-AI/xlstm.git
20+
21+
steps:
22+
- name: Checkout source repository
23+
uses: actions/checkout@v5
24+
with:
25+
fetch-depth: 0
26+
27+
- name: Configure SSH and Push to Destination
28+
run: |
29+
mkdir -p ~/.ssh
30+
echo "${{ secrets.SYNC_DEPLOY_KEY }}" | base64 --decode > ~/.ssh/sync_deploy_key
31+
chmod 600 ~/.ssh/sync_deploy_key
32+
eval "$(ssh-agent -s)"
33+
ssh-add ~/.ssh/sync_deploy_key
34+
ssh-keyscan github.com >> ~/.ssh/known_hosts
35+
36+
git remote add destination ${DESTINATION_URL}
37+
git push destination main --force

0 commit comments

Comments
 (0)