From 9be13ce0effd60031813da6ca21dd99ae6435911 Mon Sep 17 00:00:00 2001 From: wood chen Date: Sat, 30 Nov 2024 22:27:57 +0800 Subject: [PATCH] feat(deployment): add SSH deployment commands to Docker build workflow - Integrated SSH action to automate deployment commands for the proxy-go service. - Added steps to pull the latest Docker image, stop and remove the existing container, and restart the service using Docker Compose. - Enhanced the workflow for smoother deployment processes. --- .github/workflows/docker-build.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index d784adb..8238309 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -93,4 +93,18 @@ jobs: docker rm proxy-go || true docker compose -f /opt/1panel/docker/compose/proxy-go/docker-compose.yml up -d + + - name: Execute deployment commands-SH + uses: appleboy/ssh-action@master + with: + host: ${{ secrets.SERVER_HOST_SH }} + username: root + key: ${{ secrets.SERVER_SSH_KEY_SH }} + script: | + docker pull woodchen/proxy-go:latest + + docker stop proxy-go || true + docker rm proxy-go || true + + docker compose -f /opt/1panel/docker/compose/proxy-go/docker-compose.yml up -d