Skip to content

Commit 5ea5f1d

Browse files
committed
add sync
1 parent b586f73 commit 5ea5f1d

2 files changed

Lines changed: 36 additions & 0 deletions

File tree

.cnb.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
master:
2+
push:
3+
- name: sync
4+
runner:
5+
cpus: 2
6+
imports: https://cnb.cool/ecustcic/key/-/blob/main/env.yml
7+
stages:
8+
- name: sync to github
9+
image: tencentcom/git-sync
10+
settings:
11+
target_url: https://github.com/ECUSTCIC-CodeHub/ecustnews.git
12+
auth_type: https
13+
username: ${GITHUB_USERNAME}
14+
password: ${GITHUB_ACCESS_TOKEN}

.github/workflows/sync.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Sync to CNB
2+
on: [push]
3+
4+
jobs:
5+
sync:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/checkout@v3
9+
with:
10+
fetch-depth: 0
11+
12+
- name: Sync to CNB Repository
13+
run: |
14+
docker run --rm \
15+
-v ${{ github.workspace }}:${{ github.workspace }} \
16+
-w ${{ github.workspace }} \
17+
-e PLUGIN_TARGET_URL="https://cnb.cool/ecustcic/ecustnews.git" \
18+
-e PLUGIN_AUTH_TYPE="https" \
19+
-e PLUGIN_USERNAME="cnb" \
20+
-e PLUGIN_PASSWORD=${{ secrets.GIT_PASSWORD }} \
21+
-e PLUGIN_FORCE="true" \
22+
tencentcom/git-sync

0 commit comments

Comments
 (0)