-
Notifications
You must be signed in to change notification settings - Fork 1
56 lines (51 loc) · 2.09 KB
/
deploy-container.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: Deploy Docker Container
on:
workflow_call:
jobs:
deploy:
runs-on: ubuntu-22.04
environment:
name: telemetry.artemis.cit.tum.de
url: https://telemetry.artemis.cit.tum.de
steps:
- name: checkout
uses: actions/checkout@v4
with:
ref: main
- name: Copy docker-compose to server
uses: appleboy/scp-action@master
with:
host: ${{ vars.URL }}
username: ${{ secrets.SSH_USER }}
key: ${{ secrets.SSH_KEY }}
proxy_host: ${{ vars.DEPLOYMENT_GATEWAY_HOST }}
proxy_username: ${{ vars.DEPLOYMENT_GATEWAY_USER }}
proxy_key: ${{ secrets.DEPLOYMENT_GATEWAY_SSH_KEY }}
proxy_port: ${{ vars.DEPLOYMENT_GATEWAY_PORT }}
source: 'docker-compose.yml'
target: '/opt/artemis-telemetry'
- name: Copy docker-compose to server
uses: appleboy/scp-action@master
with:
host: ${{ vars.URL }}
username: ${{ secrets.SSH_USER }}
key: ${{ secrets.SSH_KEY }}
proxy_host: ${{ vars.DEPLOYMENT_GATEWAY_HOST }}
proxy_username: ${{ vars.DEPLOYMENT_GATEWAY_USER }}
proxy_key: ${{ secrets.DEPLOYMENT_GATEWAY_SSH_KEY }}
proxy_port: ${{ vars.DEPLOYMENT_GATEWAY_PORT }}
source: 'docker-compose.prod.yml'
target: '/opt/artemis-telemetry'
- name: Start Telemetry App
uses: appleboy/ssh-action@master
with:
host: ${{ vars.URL }}
username: ${{ secrets.SSH_USER }}
key: ${{ secrets.SSH_KEY }}
proxy_host: ${{ vars.DEPLOYMENT_GATEWAY_HOST }}
proxy_username: ${{ vars.DEPLOYMENT_GATEWAY_USER }}
proxy_key: ${{ secrets.DEPLOYMENT_GATEWAY_SSH_KEY }}
proxy_port: ${{ vars.DEPLOYMENT_GATEWAY_PORT }}
script: |
docker-compose -f /opt/artemis-telemetry/docker-compose.yml -f /opt/artemis-telemetry/docker-compose.prod.yml pull
docker-compose -f /opt/artemis-telemetry/docker-compose.yml -f /opt/artemis-telemetry/docker-compose.prod.yml up -d --remove-orphans --force-recreate