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.
This commit is contained in:
wood chen 2024-11-30 22:27:57 +08:00
parent 040b01f4a4
commit 9be13ce0ef

View File

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