-
Notifications
You must be signed in to change notification settings - Fork 116
54 lines (48 loc) · 1.86 KB
/
deploy_addon.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
name: Deploy Addon
on:
push:
branches: master
paths:
- 'addon/**'
- '.github/**'
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- ssh-host: SSH_HOST_2
ssh-key: SSH_KEY_2
- ssh-host: SSH_HOST_3
ssh-key: SSH_KEY_3
- ssh-host: SSH_HOST_4
ssh-key: SSH_KEY_4
steps:
- uses: actions/checkout@v1
- name: Create Docker image
run: |
docker build -t torrentio-addon:latest ./addon/
docker save torrentio-addon:latest > torrentio_addon_latest.tar
- name: Upload Docker image
uses: appleboy/scp-action@master
with:
host: ${{ secrets[matrix.ssh-host] }}
username: ${{ secrets.SSH_USERNAME }}
port: ${{ secrets.SSH_PORT }}
key: ${{ secrets[matrix.ssh-key] }}
source: torrentio_addon_latest.tar
target: /tmp/docker
overwrite: true
- name: Deploy Docker image
uses: appleboy/ssh-action@master
with:
host: ${{ secrets[matrix.ssh-host] }}
username: ${{ secrets.SSH_USERNAME }}
port: ${{ secrets.SSH_PORT }}
key: ${{ secrets[matrix.ssh-key] }}
script: |
docker load -i /tmp/docker/torrentio_addon_latest.tar
docker stop torrentio-addon
docker rm torrentio-addon
docker run -p 7050:7000 -d --name torrentio-addon --restart always --log-opt max-size=100m -e MONGODB_URI=${{ secrets.MONGODB_URI }} -e DATABASE_URI=${{ secrets.DATABASE_URI }} -e PROXY_HOSTS=${{ secrets.PROXY_HOSTS }} -e PROXY_USERNAME=${{ secrets.PROXY_USERNAME }} -e PROXY_PASSWORD=${{ secrets.PROXY_PASSWORD }} -e METRICS_USER=${{ secrets.METRICS_USER }} -e METRICS_PASSWORD=${{ secrets.METRICS_PASSWORD }} torrentio-addon:latest
docker image prune -f