File tree Expand file tree Collapse file tree 1 file changed +40
-0
lines changed
Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Original file line number Diff line number Diff line change 1+ name : " Sync to GitCode"
2+
3+ on :
4+ push :
5+ branches :
6+ - " main"
7+
8+ jobs :
9+ sync :
10+ runs-on : ubuntu-latest
11+ steps :
12+ - name : Checkout code
13+ uses : actions/checkout@v4
14+ with :
15+ fetch-depth : 0
16+ fetch-tags : true
17+
18+ - name : Set up credentials
19+ shell : bash
20+ run : |
21+ mkdir -p ~/.ssh
22+ echo "${{ secrets.GITCODE_SSHKEY_PUBLIC }}" > ~/.ssh/id_ed25519.pub
23+ echo "${{ secrets.GITCODE_SSHKEY_PRIVATE }}" > ~/.ssh/id_ed25519
24+ chmod 600 ~/.ssh/id_ed25519
25+ chmod 644 ~/.ssh/id_ed25519.pub
26+ chmod 700 ~/.ssh
27+
28+ - name : Scan key
29+ shell : bash
30+ run : ssh-keyscan -t rsa gitcode.com >> ~/.ssh/known_hosts
31+
32+ - name : Sync with GitCode
33+ shell : bash
34+ # WARNING: never force push
35+ run : |
36+ git config --global user.name "GitHub-CI"
37+ git config --global user.email "dummy@gmail.com"
38+ git remote add gitcode git@gitcode.com:preppipe/preppipe-python.git
39+ git push gitcode main
40+ git push gitcode --tags
You can’t perform that action at this time.
0 commit comments