-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (40 loc) · 1.2 KB
/
deploy-client.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
36
37
38
39
40
41
42
43
44
45
46
name: Client Deploy
on:
push:
paths:
- 'client/**'
jobs:
build-and-push-client-image:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build Docker Image
run: docker-compose build client
- name: Push Docker Image
run: docker-compose push client
deploy-client-image:
needs: build-and-push-client-image
runs-on: ubuntu-latest
steps:
- name: SSH connection
uses: appleboy/ssh-action@v1.0.3
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.SERVER_USER }}
password: ${{ secrets.SERVER_PASSWORD }}
port: 22
script: |
cd app/WebManager
docker-compose stop wm-client
docker rm -f wm-client || true
docker rmi -f alwaysmeow/webmanager-client || true
git pull origin prod
docker pull alwaysmeow/webmanager-client:latest