-
Notifications
You must be signed in to change notification settings - Fork 5
56 lines (52 loc) · 1.47 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: scp files
on:
push:
branches:
- placeholder
jobs:
deploy_project:
name: Deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v42
with:
since_last_remote_commit: true
separator: ","
- name: copy file via ssh password
uses: appleboy/scp-action@v0.1.7
with:
host: "104.43.210.41"
username: "yokwejuste"
password: "Password123!"
port: "22"
source: "."
target: ${{ github.event.repository.name }}
build_project:
name: Build
needs: deploy_project
runs-on: ubuntu-latest
steps:
- name: executing remote ssh commands using password
uses: appleboy/ssh-action@v1.0.3
with:
host: "104.43.210.41"
username: "yokwejuste"
password: "Password123!"
port: "22"
script: |
if [ "$(docker ps -aq)" != "" ]; then
docker rm -f $(docker ps -aq)
fi
if [ "$(docker images -q)" != "" ]; then
docker rmi -f $(docker images -q)
fi
if [ "$(docker volume ls -q)" != "" ]; then
docker volume rm -f $(docker volume ls -q)
fi
cd visuleo_port
docker system prune -af
docker compose down --volumes
docker compose up -d --build