From 48f262e1f3bb785b51119593512f4e2f02f37f56 Mon Sep 17 00:00:00 2001 From: whyour Date: Thu, 17 Nov 2022 00:23:24 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=20workflow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/COPY_STATIC.yml | 38 ++++++++++++++++++++++++ .github/workflows/build_docker_image.yml | 2 ++ 2 files changed, 40 insertions(+) create mode 100644 .github/COPY_STATIC.yml diff --git a/.github/COPY_STATIC.yml b/.github/COPY_STATIC.yml new file mode 100644 index 00000000..f8d1ce59 --- /dev/null +++ b/.github/COPY_STATIC.yml @@ -0,0 +1,38 @@ +name: COPY STATIC + +on: + push: + branches: + - 'master' + - 'develop' + # Sequence of patterns matched against refs/tags + tags: + - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 + workflow_dispatch: + +jobs: + to_gitlab: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - uses: pixta-dev/repository-mirroring-action@v1 + with: + target_repo_url: + git@gitlab.com:whyour/qinglong-static.git + ssh_private_key: + ${{ secrets.GITLAB_SSH_PK }} + + to_gitee: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - uses: pixta-dev/repository-mirroring-action@v1 + with: + target_repo_url: + git@gitee.com:whyour/qinglong-static.git + ssh_private_key: + ${{ secrets.GITLAB_SSH_PK }} \ No newline at end of file diff --git a/.github/workflows/build_docker_image.yml b/.github/workflows/build_docker_image.yml index 6dc9cb68..43273b23 100644 --- a/.github/workflows/build_docker_image.yml +++ b/.github/workflows/build_docker_image.yml @@ -62,8 +62,10 @@ jobs: GITHUB_BRANCH: ${{ github.ref_name }} run: | mkdir -p tmp + mkdir -p .github/workflows cd ./tmp cp -rf ../static/* ./ + cp ../.github/COPY_STATIC.yml ./.github/workflows/ git init -b ${GITHUB_BRANCH} && git add . git config --local user.name 'github-actions[bot]' git config --local user.email 'github-actions[bot]@users.noreply.github.com'