个人导航页
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

54 lines
1.8 KiB

name: Sync-Gitee-Coding
on:
push:
branches: [main]
jobs:
push-to-mirror:
runs-on: ubuntu-latest
steps:
- name: Clone
run: |
git config --global init.defaultBranch main
git init
git remote add origin https://${GITHUB_USERNAME}:${GITHUB_TOKEN}@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
env:
GITHUB_REPOSITORY: shenweiyan/WebStack-Hugo
GITHUB_USERNAME: ${{ secrets.GH_USERNAME }}
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
- name: Push to Coding
run: |
echo "stop!"
#remote_repo="https://${CODING_USERNAME}:${CODING_PASSWORD}@e.coding.net/${CODING_REPOSITORY}.git"
#git remote add coding "${remote_repo}"
#git show-ref # useful for debugging
#git branch --verbose
# publish all
#git push --all --force coding
#git push --tags --force coding
env:
CODING_REPOSITORY: shumlab/webstack/WebStack-Hugo
#CODING_USERNAME: ${{ secrets.CODING_USERNAME }}
#CODING_PASSWORD: ${{ secrets.CODING_PASSWORD }}
- name: Push to Gitee
run: |
#echo "stop!"
remote_repo="https://${GITEE_USERNAME}:${GITEE_PASSWORD}@gitee.com/${GITEE_REPOSITORY}.git"
git remote add gitee "${remote_repo}"
git show-ref # useful for debugging
git branch --verbose
# publish all
git push --all --force gitee
git push --tags --force gitee
env:
GITEE_REPOSITORY: shenweiyan/WebStack-Hugo
GITEE_USERNAME: ${{ secrets.GITEE_USERNAME }}
GITEE_PASSWORD: ${{ secrets.GITEE_PASSWORD }}