Repository navigation
53 lines (49 loc) · 1.83 KB
/
Copy pathPushGiteeCoding.yml
File metadata and controls
53 lines (49 loc) · 1.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
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: leonme/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: leonme/WebStack-Hugo
GITEE_USERNAME: ${{ secrets.GITEE_USERNAME }}
GITEE_PASSWORD: ${{ secrets.GITEE_PASSWORD }}