forked from besscroft/PicImpact
-
Notifications
You must be signed in to change notification settings - Fork 0
35 lines (29 loc) · 997 Bytes
/
deploy-vps.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
name: Deploy to VPS
on:
workflow_run:
workflows: ["Dev Docker Multi-arch Image CI & CD"]
types: [completed]
jobs:
deploy:
name: Deploy to VPS
runs-on: ubuntu-latest
steps:
- name: Deploy to VPS
uses: appleboy/[email protected]
with:
host: ${{ secrets.VPS_HOST }}
username: ${{ secrets.VPS_USER }}
password: ${{ secrets.VPS_PASSWORD }}
script: |
echo "Pulling latest Docker image..."
docker pull ${{ secrets.DOCKERHUB_USERNAME }}/picimpact:latest
echo "Stopping old container..."
docker stop picimpact || true
docker rm picimpact || true
echo "Starting new container..."
docker run -d --name picimpact \
-p 3000:3000 \
-e DATABASE_URL="${{ secrets.DATABASE_URL }}" \
-e AUTH_SECRET="${{ secrets.AUTH_SECRET }}" \
${{ secrets.DOCKERHUB_USERNAME }}/picimpact:latest
echo "Deployment completed!"