增加 workflow

This commit is contained in:
whyour 2022-11-17 00:23:24 +08:00
parent bc49a7db50
commit 48f262e1f3
2 changed files with 40 additions and 0 deletions

38
.github/COPY_STATIC.yml vendored Normal file
View File

@ -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 }}

View File

@ -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'