-
Notifications
You must be signed in to change notification settings - Fork 7
69 lines (62 loc) · 1.78 KB
/
deploy-api-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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: Deploy api and client
on:
push:
branches:
- main
paths:
- 'client/**'
- 'api/**'
- '.github/workflows/deploy-api-client.yml'
- 'docker-compose.yaml'
workflow_dispatch:
schedule:
- cron: '0 0 15 * *'
permissions:
actions: write
checks: read
deployments: write
pull-requests: write
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
path: substrait-fiddle
- name: Copy files to remote repository
uses: appleboy/[email protected]
with:
host: ${{ secrets.DEPLOY_HOST_DNS }}
username: ${{ secrets.DEPLOY_USERNAME }}
key: ${{ secrets.DEPLOY_SSH_KEY }}
rm: true
source: "substrait-fiddle/*"
target: ~/deployment
- name: Deploy the docker-compose
uses: appleboy/[email protected]
env:
VITE_SESSION_SECRET: ${{ secrets.VITE_SESSION_SECRET }}
with:
host: ${{ secrets.DEPLOY_HOST_DNS }}
username: ${{ secrets.DEPLOY_USERNAME }}
key: ${{ secrets.DEPLOY_SSH_KEY }}
envs: VITE_SESSION_SECRET
script: |
export VITE_SESSION_SECRET=$VITE_SESSION_SECRET
cd ~/deployment/substrait-fiddle
docker-compose stop
docker-compose rm -f
docker-compose build --no-cache
docker-compose up -d
- name: Cleanup unused docker images, volumes and build cache
uses: appleboy/[email protected]
with:
host: ${{ secrets.DEPLOY_HOST_DNS }}
username: ${{ secrets.DEPLOY_USERNAME }}
key: ${{ secrets.DEPLOY_SSH_KEY }}
script: |
docker container prune -f
docker image prune -f
docker volume prune -f
docker builder prune -f