-
Notifications
You must be signed in to change notification settings - Fork 22
51 lines (46 loc) · 1.68 KB
/
gradlew-publish-and-deploy-live.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
name: Deploy production
on:
push:
branches:
- master
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Publish to Registry
uses: elgohr/Publish-Docker-Github-Action@master
with:
name: romanew/invest:live-latest
username: ${{ secrets.DOCKER_PUBLISH_REGISTRY_USERNAME }}
password: ${{ secrets.DOCKER_PUBLISH_REGISTRY_PASSWORD }}
dockerfile: Dockerfile.App
deploy:
needs: publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Copy docker-compose-app-live.yml
uses: garygrossgarten/github-action-scp@release
with:
local: docker-compose-app-live.yml
remote: ./tinkoff-invest-robot/docker-compose-app-live.yml
host: 31.186.136.15
username: root
privateKey: ${{ secrets.SSH_PRIVATE_KEY_PERSONAL }}
- name: Start using docker-compose
uses: appleboy/ssh-action@master
with:
host: 31.186.136.15
username: root
key: ${{ secrets.SSH_PRIVATE_KEY_PERSONAL }}
script: |
cd tinkoff-invest-robot
export TINKOFF_TOKEN=${{ secrets.TINKOFF_TOKEN }}
export POSTGRES_USER=${{ secrets.POSTGRES_USER }}
export POSTGRES_PASSWORD=${{ secrets.POSTGRES_PASSWORD }}
export TELEGRAM_BOT_TOKEN=${{ secrets.TELEGRAM_BOT_TOKEN }}
export TELEGRAM_BOT_CHAT_ID=${{ secrets.TELEGRAM_BOT_CHAT_ID }}
docker-compose -f docker-compose-app-live.yml down
docker-compose -f docker-compose-app-live.yml pull
docker-compose -f docker-compose-app-live.yml up -d