ci: 添加 SSH 部署步骤
Build and Push Docker Image / build-and-push (push) Successful in 1m5s
Build and Push Docker Image / deploy (push) Successful in 9s
Docker Build / Build and Push Docker Image (push) Has been cancelled
Docker Build / Deploy to Server (push) Has been cancelled

This commit is contained in:
2026-07-05 19:43:36 +08:00
parent 04420c4ad9
commit 85d5d14845
+19 -1
View File
@@ -45,4 +45,22 @@ jobs:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
no-cache: true
no-cache: true
deploy:
needs: build-and-push
runs-on: ubuntu
steps:
- name: Deploy to server
uses: appleboy/ssh-action@v1.0.3
with:
host: ${{ secrets.DEPLOY_HOST }}
username: ${{ secrets.DEPLOY_USER }}
password: ${{ secrets.DEPLOY_PASSWORD }}
script: |
cd ${{ secrets.DEPLOY_PATH }}
echo "${{ secrets.TOKEN }}" | docker login git.viaeon.com -u ${{ github.actor }} --password-stdin
docker compose pull
docker compose up -d
docker image prune -af