From c719c03a44555ca8755f538a1f659ce10315b6af Mon Sep 17 00:00:00 2001 From: z0z0r4 Date: Wed, 2 Oct 2024 22:21:20 +0800 Subject: [PATCH] Create gitlab-sync.yml --- .github/workflows/gitlab-sync.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/gitlab-sync.yml diff --git a/.github/workflows/gitlab-sync.yml b/.github/workflows/gitlab-sync.yml new file mode 100644 index 0000000..58fd327 --- /dev/null +++ b/.github/workflows/gitlab-sync.yml @@ -0,0 +1,26 @@ +# 通过 Github action, 在仓库的每一次 commit 后自动同步到 Gitee 上 +name: sync2gitlab +on: + push: + branches: + - main +jobs: + repo-sync: + env: + SSH_PRIVATE_KEY: ${{ secrets.GITLAB_PRIVATE_KEY }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + persist-credentials: false + + - name: Configure Git + run: | + git config --global --add safe.directory /github/workspace + + - name: sync github -> gitee + uses: wearerequired/git-mirror-action@master + if: env.SSH_PRIVATE_KEY + with: + source-repo: "git@github.com:${{ github.repository }}.git" + destination-repo: "git@git.pysio.online:z0z0r4/mcim.git"