feat: add deployment step to production server in Docker workflow
This commit is contained in:
15
.github/workflows/docker-publish.yml
vendored
15
.github/workflows/docker-publish.yml
vendored
@@ -63,3 +63,18 @@ jobs:
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
|
||||
- name: Deploy to production server
|
||||
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
|
||||
uses: appleboy/ssh-action@v1.2.0
|
||||
with:
|
||||
host: ${{ secrets.SERVER_HOST }}
|
||||
username: ${{ secrets.SERVER_USER }}
|
||||
key: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||
port: ${{ secrets.SERVER_PORT || 22 }}
|
||||
script: |
|
||||
cd ${{ secrets.SERVER_PATH || '/root/crew-infrastructure' }}
|
||||
export SLIPMATZ_WEB_TAG=main
|
||||
docker compose pull slipmatz_web
|
||||
docker compose up -d slipmatz_web
|
||||
docker compose ps slipmatz_web
|
||||
|
||||
Reference in New Issue
Block a user