Skip to content

fix(Github Action): 修复RSA验证 #6

fix(Github Action): 修复RSA验证

fix(Github Action): 修复RSA验证 #6

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@v4
- 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: Push files
run: |
echo "${SSH_KEY}" > private_key.pem
chmod 600 private_key.pem
GIT_SSH_COMMAND="ssh -i private_key.pem" git push gitlab_mirror main