-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (71 loc) · 5.04 KB
/
build_and_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
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: Build and push containers to ghcr
env:
DOCKER_USER: ${{ secrets.DOCKER_USER }}
DOCKER_PASS: ${{ secrets.DOCKER_PASS }}
on:
push:
branches:
- main
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Git clone on our repo
uses: actions/checkout@v2
- name: Login to Dockerhub
working-directory: ${{ github.workspace }}/docker-stack/golem-reputation-backend
run: make login
- name: Build Containers
working-directory: ${{ github.workspace }}/docker-stack/golem-reputation-backend
run: make build-amd64
- name: Push Containers
working-directory: ${{ github.workspace }}/docker-stack/golem-reputation-backend
run: make push-amd64
- name: Deploy to Asia reputation instance
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.ASIA_HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.ASIA_KEY }}
port: ${{ secrets.PORT }}
script: |
docker service update --force --image ghcr.io/golemfactory/golem-reputation-backend:${{ github.sha }} reputation_django
docker service update --force --image ghcr.io/golemfactory/golem-reputation-backend-celery-yagna:${{ github.sha }} reputation_benchmarker_worker
docker service update --force --image ghcr.io/golemfactory/golem-reputation-backend-celery-yagna:${{ github.sha }} reputation_benchmarker_worker014
docker service update --force --image ghcr.io/golemfactory/golem-reputation-backend-celery:${{ github.sha }} reputation_celery
docker service update --force --image ghcr.io/golemfactory/golem-reputation-backend-celery-beat:${{ github.sha }} reputation_celery_beat
docker service update --force --image ghcr.io/golemfactory/golem-reputation-backend-celery-yagna:${{ github.sha }} reputation_uptime_worker
docker service update --force --image ghcr.io/golemfactory/golem-reputation-backend-celery-yagna:${{ github.sha }} reputation_ping_worker
docker service update --force --image ghcr.io/golemfactory/golem-reputation-backend-celery-yagna:${{ github.sha }} reputation_ping_worker_p2p
docker image prune -f
- name: Deploy to europe reputation instance
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.EU_HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.EU_KEY }}
port: ${{ secrets.PORT }}
script: |
docker service update --force --image ghcr.io/golemfactory/golem-reputation-backend:${{ github.sha }} reputation_django
docker service update --force --image ghcr.io/golemfactory/golem-reputation-backend-celery:${{ github.sha }} reputation_celery
docker service update --force --image ghcr.io/golemfactory/golem-reputation-backend-celery-beat:${{ github.sha }} reputation_celery_beat
docker service update --force --image ghcr.io/golemfactory/golem-reputation-backend-celery-yagna:${{ github.sha }} reputation_uptime_worker
docker service update --force --image ghcr.io/golemfactory/golem-reputation-backend-celery-yagna:${{ github.sha }} reputation_ping_worker
docker service update --force --image ghcr.io/golemfactory/golem-reputation-backend-celery-yagna:${{ github.sha }} reputation_ping_worker_p2p
docker image prune -f
- name: Deploy to US reputation instance
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.US_HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.US_KEY }}
port: ${{ secrets.PORT }}
script: |
docker service update --force --image ghcr.io/golemfactory/golem-reputation-backend:${{ github.sha }} reputation_django
docker service update --force --image ghcr.io/golemfactory/golem-reputation-backend-celery:${{ github.sha }} reputation_celery
docker service update --force --image ghcr.io/golemfactory/golem-reputation-backend-celery-beat:${{ github.sha }} reputation_celery_beat
docker service update --force --image ghcr.io/golemfactory/golem-reputation-backend-celery-yagna:${{ github.sha }} reputation_uptime_worker
docker service update --force --image ghcr.io/golemfactory/golem-reputation-backend-celery-yagna:${{ github.sha }} reputation_ping_worker
docker service update --force --image ghcr.io/golemfactory/golem-reputation-backend-celery-yagna:${{ github.sha }} reputation_ping_worker_p2p
docker image prune -f