-
-
Notifications
You must be signed in to change notification settings - Fork 29
177 lines (164 loc) · 5.83 KB
/
deploy-prod.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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
name: Release
on:
push:
branches:
- main
jobs:
changes:
runs-on: ubuntu-latest
outputs:
annotation-ui: ${{ steps.filter.outputs.annotation-ui }}
uli-website: ${{ steps.filter.outputs.uli-website}}
ogbv-ml-rest: ${{ steps.filter.outputs.ogbv-ml-rest }}
uli-server: ${{ steps.filter.outputs.uli-server }}
steps:
- uses: actions/checkout@v2
with:
ref: main
- uses: dorny/[email protected]
id: filter
with:
filters: |
annotation-ui:
- 'annotators/backend/**/*'
- 'annotators/annotation-ui/**/*'
uli-website:
- 'uli-website/**/*'
ogbv-ml-rest:
- 'ogbv-ml-rest/**/*'
uli-server:
- 'browser-extension/api-server/**/*'
annotation-ui:
runs-on: ubuntu-latest
needs: changes
if: ${{ needs.changes.outputs.annotation-ui == 'true' }}
steps:
- uses: actions/checkout@v2
with:
ref: main
- name: Declare some variables
id: vars
shell: bash
run: |
echo "setting variables"
echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
cd annotators/annotation-ui
npm install --force
npm run build
- name: Publish to Docker
uses: elgohr/Publish-Docker-Github-Action@master
with:
username: tattletech
password: ${{ secrets.DOCKER_PASSWORD }}
name: tattletech/ogbv_annotator
tags: ${{ steps.vars.outputs.sha_short }}
workdir: annotators/backend/
- name: deploy to cluster
uses: steebchen/[email protected]
with: # defaults to latest kubectl binary version
config: ${{ secrets.PROD_KUBE_CONFIG_DATA }}
command: set image --record deployment/annotation-ui annotation-ui=tattletech/ogbv_annotator:${{ steps.vars.outputs.sha_short }}
- name: verify deployment
uses: steebchen/[email protected]
with:
config: ${{ secrets.PROD_KUBE_CONFIG_DATA }}
version: v1.21.0 # specify kubectl binary version explicitly
command: rollout status deployment/annotation-ui
uli-website:
runs-on: ubuntu-latest
needs: changes
if: ${{ needs.changes.outputs.uli-website == 'true' }}
steps:
- uses: actions/checkout@v2
with:
ref: main
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ap-south-1
- name: Install Packages
run: |
pwd
cd uli-website
pwd
ls
npm install
npm run build
npm run deploy
- name: Notify on Slack
uses: rtCamp/[email protected]
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_MESSAGE: "Deployed uli-website to production environment"
SLACK_TITLE: "deploy-production workflow complete"
SLACK_COLOR: "#020637"
SLACK_ICON: https://tattle-media.s3.amazonaws.com/monogram-dark.svg
ogbv-ml-rest:
runs-on: ubuntu-latest
needs: changes
if: ${{ needs.changes.outputs.ogbv-ml-rest == 'true' }}
steps:
- name: Checkout
uses: actions/checkout@v2
with:
ref: main
- name: Declare some variables
id: vars
shell: bash
run: |
echo "setting variables"
echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
- name: Build and Push to Docker
uses: elgohr/Publish-Docker-Github-Action@master
with:
username: tattletech
password: ${{ secrets.DOCKER_PASSWORD }}
name: tattletech/ogbv-ml-rest
tags: ${{ steps.vars.outputs.sha_short }}
workdir: ogbv-ml-rest
# - name: deploy to cluster
# uses: steebchen/[email protected]
# with: # defaults to latest kubectl binary version
# config: ${{ secrets.PROD_KUBE_CONFIG_DATA }}
# command: set image --record deployment/ogbv-ml-rest ogbv-ml-rest=tattletech/ogbv-ml-rest:${{ steps.vars.outputs.sha_short }}
# - name: verify deployment
# uses: steebchen/[email protected]
# with:
# config: ${{ secrets.PROD_KUBE_CONFIG_DATA }}
# version: v1.21.0 # specify kubectl binary version explicitly
# command: rollout status deployment/ogbv-ml-rest
uli-server:
runs-on: ubuntu-latest
needs: changes
if: ${{ needs.changes.outputs.uli-server == 'true' }}
steps:
- uses: actions/checkout@v2
with:
ref: main
- name: Declare some variables
id: vars
shell: bash
run: |
echo "setting variables"
echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
- name: Publish to Docker
uses: elgohr/Publish-Docker-Github-Action@master
with:
username: tattletech
password: ${{ secrets.DOCKER_PASSWORD }}
name: tattletech/ogbv-plugin
tags: ${{ steps.vars.outputs.sha_short }}
workdir: browser-extension/api-server/
- name: deploy to cluster
uses: steebchen/[email protected]
with: # defaults to latest kubectl binary version
config: ${{ secrets.PROD_KUBE_CONFIG_DATA }}
command: set image --record deployment/ogbv-plugin ogbv-plugin=tattletech/ogbv-plugin:${{ steps.vars.outputs.sha_short }}
- name: verify deployment
uses: steebchen/[email protected]
with:
config: ${{ secrets.PROD_KUBE_CONFIG_DATA }}
version: v1.21.0 # specify kubectl binary version explicitly
command: rollout status deployment/ogbv-plugin