-
Notifications
You must be signed in to change notification settings - Fork 85
35 lines (31 loc) · 1.09 KB
/
deploy.yml
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
# trigger on docker build workflow
# only works on a default branch
on:
workflow_run:
workflows: ['docker build - disabled']
types:
- completed
workflow_dispatch:
jobs:
deploy:
name: Deploy image from Dockerhub to VPS with ssh
runs-on: ubuntu-latest
steps:
- name: Deploy latest image
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.VPS_HOST }}
username: ${{ secrets.VPS_USERNAME }}
key: ${{ secrets.VPS_KEY_ED25519 }}
port: ${{ secrets.VPS_PORT }}
script_stop: true
script: |
cd /home/ubuntu/traefik-proxy/apps/nextjs-prisma-boilerplate
echo 'Old image id:'
docker inspect --format='{{index .RepoDigests 0}}' nemanjamitic/nextjs-prisma-boilerplate:latest
docker-compose down
docker image rm nemanjamitic/nextjs-prisma-boilerplate:latest
docker-compose up -d
echo 'New image id:'
docker inspect --format='{{index .RepoDigests 0}}' nemanjamitic/nextjs-prisma-boilerplate:latest