Skip to content

Commit 181039c

Browse files
committed
✨create sync_cnbc.yml
1 parent 2dfc089 commit 181039c

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

.github/workflows/sync_cnbc.yml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Sync-To-CNBC
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
push-to-mirror:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Clone
13+
run: |
14+
git init
15+
git remote add origin https://github.com/${GITHUB_REPOSITORY}.git
16+
git fetch --all
17+
for branch in `git branch -a | grep remotes | grep -v HEAD`; do
18+
git branch --track ${branch##*/} $branch
19+
done
20+
- name: Push to CNBC
21+
run: |
22+
remote_repo="https://${CNBC_USERNAME}:${CNBC_PASSWORD}@cnb.cool/tca/tools/${GITHUB_REPOSITORY##*/}.git"
23+
git remote add cnbc "${remote_repo}"
24+
git show-ref # debug
25+
git branch --verbose
26+
git push --all cnbc
27+
git push --tags cnbc
28+
env:
29+
CNBC_USERNAME: ${{ secrets.CNBC_USERNAME }}
30+
CNBC_PASSWORD: ${{ secrets.CNBC_PASSWORD }}

0 commit comments

Comments
 (0)