-
Notifications
You must be signed in to change notification settings - Fork 5
42 lines (36 loc) · 1.28 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
name: Deploy
on:
push:
branches: [master]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Create Docker image
run: |
docker build -t anime-kitsu:latest . -f Dockerfile.deprecated
docker save anime-kitsu:latest > kitsu_latest.tar
- name: Upload Docker image
uses: appleboy/scp-action@master
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USERNAME }}
port: ${{ secrets.SSH_PORT }}
key: ${{ secrets.SSH_KEY }}
source: kitsu_latest.tar
target: /tmp/docker
overwrite: true
- name: Deploy Docker image
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USERNAME }}
port: ${{ secrets.SSH_PORT }}
key: ${{ secrets.SSH_KEY }}
script: |
docker load -i /tmp/docker/kitsu_latest.tar
docker stop anime-kitsu
docker rm anime-kitsu
docker run -p 7000:7000 -d --name anime-kitsu --restart always --log-opt max-size=100m -e MONGODB_URI=${{ secrets.MONGODB_URI }} -e FANART_APIKEY=${{ secrets.FANART_APIKEY }} anime-kitsu:latest
docker image prune -f