Update README.md #57
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
name: code-sync | |
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 Gitcode | |
run: | | |
remote_repo="https://shenweiyan:${GITCODE_PAT}@gitcode.com/${GITCODE_REPOSITORY}.git" | |
git remote add gitcode "${remote_repo}" | |
git show-ref | |
git branch --verbose | |
# publish all | |
git push --all --force gitcode | |
git push --tags --force gitcode | |
env: | |
GITCODE_REPOSITORY: shenweiyan/WebStack-Hugo | |
GITCODE_PAT: ${{ secrets.GITCODE_PAT }} | |
- name: Push to Gitee | |
uses: Yikun/hub-mirror-action@master | |
with: | |
src: github/shenweiyan | |
dst: gitee/shenweiyan | |
dst_key: ${{ secrets.GITEE_PRIVATE_KEY }} | |
dst_token: ${{ secrets.GITEE_TOKEN }} | |
static_list: "WebStack-Hugo" | |
force_update: true | |
timeout: '0.5h' |