Skip to content

Commit 5da1fb5

Browse files
author
deepin-admin-bot
committed
"chore: Sync by "
1 parent c64a15c commit 5da1fb5

1 file changed

Lines changed: 7 additions & 42 deletions

File tree

.github/workflows/backup-to-gitlab.yml

Lines changed: 7 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -6,47 +6,12 @@ concurrency:
66
cancel-in-progress: true
77

88
jobs:
9-
backup-to-gitlab:
10-
if: github.repository_owner == 'linuxdeepin'
11-
name: backup-to-gitlab
12-
runs-on: ubuntu-latest
13-
steps:
14-
- uses: actions/checkout@v2
15-
with:
16-
repository: "linuxdeepin/jenkins-bridge-client"
17-
path: jenkins-bridge-client
18-
19-
- name: Install Client
20-
run: |
21-
cd $GITHUB_WORKSPACE/jenkins-bridge-client
22-
go build .
23-
sudo install -Dvm755 jenkins-bridge-client -t /usr/bin/
24-
- name: Trigger sync
25-
id: generate-runid
26-
run: |
27-
echo "::set-output name=RUN_ID::$(jenkins-bridge-client -triggerSync -token '${{ secrets.BRIDGETOKEN }}')"
28-
- name: Print log
29-
run: |
30-
jenkins-bridge-client -printlog -token "${{ secrets.BRIDGETOKEN }}" -runid "${{ steps.generate-runid.outputs.RUN_ID }}"
9+
backup-to-gitlabwh:
10+
uses: linuxdeepin/.github/.github/workflows/backup-to-gitlabwh.yml@master
11+
secrets:
12+
BRIDGETOKEN: ${{ secrets.BRIDGETOKEN }}
3113

3214
backup-to-gitee:
33-
if: github.repository_owner == 'linuxdeepin'
34-
runs-on: ubuntu-latest
35-
steps:
36-
- name: create-repo
37-
run: |
38-
repo=${{ github.event.repository.name }}
39-
homepage="https://github.com/linuxdeepin/${repo}"
40-
description="mirror of ${homepage}"
41-
# remove '.' prefix
42-
repo=${repo#"."}
43-
curl -X POST --header 'Content-Type: application/json;charset=UTF-8' 'https://gitee.com/api/v5/enterprises/linuxdeepin/repos' -d '{"private": 1,"access_token":"${{ secrets.GITEE_SYNC_TOKEN }}","name":"'"$repo"'","description":"'"$description"'","homepage":"'"$homepage"'","has_issues":"false","has_wiki":"false","can_comment":"false"}' || true
44-
- name: push
45-
run: |
46-
git clone --bare https://github.com/linuxdeepin/${{ github.event.repository.name }}.git .git
47-
repo=${{ github.event.repository.name }}
48-
# remove '.' prefix
49-
repo=${repo#"."}
50-
git remote set-url origin https://myml:${{ secrets.GITEE_SYNC_TOKEN }}@gitee.com/linuxdeepin/${repo}.git
51-
git push -f --all --prune origin
52-
git push --tags origin
15+
uses: linuxdeepin/.github/.github/workflows/backup-to-gitee.yml@master
16+
secrets:
17+
GITEE_SYNC_TOKEN: ${{ secrets.GITEE_SYNC_TOKEN }}

0 commit comments

Comments
 (0)