diff --git a/.gitea/workflows/docker_build.yml b/.gitea/workflows/docker_build.yml index 263b4af..9627271 100644 --- a/.gitea/workflows/docker_build.yml +++ b/.gitea/workflows/docker_build.yml @@ -64,15 +64,15 @@ jobs: build-args: | BUILDKIT_INLINE_CACHE=1 - # - name: 通过SSH部署到服务器 - # if: ${{ steps.branch_name.outputs.branch == 'main' }} # 仅main分支触发部署 - # run: | - # ssh -o StrictHostKeyChecking=no \ - # -i "${{ secrets.SSH_PRIVATE_KEY }}" \ - # ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} << 'EOF' - # # 拉取最新镜像 - # docker pull ${{ env.REGISTRY }}/${{ env.GHCR_USER }}/${{ env.IMAGE_NAME }}:${{ steps.branch_name.outputs.tag }} - # # 重启服务(根据实际情况修改) - # docker-compose down || true - # docker-compose up -d - # EOF \ No newline at end of file + - name: SSH 部署服务器 + uses: appleboy/ssh-action@master + with: + host: '113.44.68.213' + username: root + password: Havocantelope420 + port: '22' + script: | + docker pull ghcr.io/catface-cn/catface_backend_go:latest + docker stop catface_backend_go || true + docker rm catface_backend_go || true + docker run -d --name catface_backend_go -p 20201:20201 ghcr.io/catface-cn/catface_backend_go:latest \ No newline at end of file diff --git a/.gitea/workflows/ssh_test.yml b/.gitea/workflows/ssh_test.yml index d9bd48a..dc1f345 100644 --- a/.gitea/workflows/ssh_test.yml +++ b/.gitea/workflows/ssh_test.yml @@ -18,5 +18,5 @@ jobs: password: Havocantelope420 port: '22' script: | - echo "Running command on remote server" - ls -lha + docker pull hello-world + docker run hello-world