-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Sync-To-CNBC | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
push-to-mirror: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Clone | ||
run: | | ||
git init | ||
git remote add origin https://github.com/${GITHUB_REPOSITORY}.git | ||
git fetch --all | ||
for branch in `git branch -a | grep remotes | grep -v HEAD`; do | ||
git branch --track ${branch##*/} $branch | ||
done | ||
- name: Push to CNBC | ||
run: | | ||
remote_repo="https://${CNBC_USERNAME}:${CNBC_PASSWORD}@cnb.cool/tca/tools/${GITHUB_REPOSITORY##*/}.git" | ||
git remote add cnbc "${remote_repo}" | ||
git show-ref # debug | ||
git branch --verbose | ||
git push --all cnbc | ||
git push --tags cnbc | ||
env: | ||
CNBC_USERNAME: ${{ secrets.CNBC_USERNAME }} | ||
CNBC_PASSWORD: ${{ secrets.CNBC_PASSWORD }} |