Skip to content

Commit

Permalink
Test(GitHub Action): 测试GitHub Action
Browse files Browse the repository at this point in the history
  • Loading branch information
Mintimate committed Nov 14, 2023
1 parent fc74c42 commit 1f295e2
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/mirrorToGitLab.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Sync Repo To GitLab

on:
push:
branches:
- main

env:
SSH_KEY: ${{ secrets.GITLAB_DEPLOY_KEY }} # 服务器私钥
DEPLOY_HOST: ${{ secrets.GITLAB_DEPLOY_HOST }} # 服务器部署地址
DEPLOY_USERNAME: ${{ secrets.GITLAB_DEPLOY_USERNAME }} # 部署用户
DEPLOY_EMAIL: ${{ secrets.GITLAB_DEPLOY_EMAIL }} # 部署邮箱

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Prepare to Gitlab repo
run: |
git config --global user.name ${{ env.DEPLOY_USERNAME }}
git config --global user.email ${{ env.DEPLOY_EMAIL }}
git remote add gitlab_mirror ${{ env.DEPLOY_HOST }}
- name: Commit files
run: |
git add .
git commit -m "Sync files from Github repo"
- name: Push files
env:
ssh-key: ${{ env.SSH_KEY }}
run: |
git push gitlab_mirror main

0 comments on commit 1f295e2

Please sign in to comment.