-
Notifications
You must be signed in to change notification settings - Fork 0
144 lines (138 loc) · 4.92 KB
/
cd.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
name: CD - Deploy Prod
on:
release:
types: [published]
jobs:
buildApi:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push API to GitHub Packages
uses: docker/build-push-action@v2
with:
context: src/api/
platforms: linux/amd64,linux/arm64
push: true
tags: |
ghcr.io/agile-waterfall/flooq-api:latest
ghcr.io/agile-waterfall/flooq-api:${{ github.event.release.tag_name }}
buildIdentity:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push Identity to GitHub Packages
uses: docker/build-push-action@v2
with:
context: src/identity/
platforms: linux/amd64,linux/arm64
push: true
tags: |
ghcr.io/agile-waterfall/flooq-identity:latest
ghcr.io/agile-waterfall/flooq-identity:${{ github.event.release.tag_name }}
buildEditor:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push Editor to GitHub Packages
uses: docker/build-push-action@v2
with:
context: src/editor/
push: true
tags: |
ghcr.io/agile-waterfall/flooq-editor:latest
ghcr.io/agile-waterfall/flooq-editor:${{ github.event.release.tag_name }}
buildExecutor:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push Executor to GitHub Packages
uses: docker/build-push-action@v2
with:
context: src/executor/
push: true
tags: |
ghcr.io/agile-waterfall/flooq-executor:latest
ghcr.io/agile-waterfall/flooq-executor:${{ github.event.release.tag_name }}
buildLanding:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push Landing to GitHub Packages
uses: docker/build-push-action@v2
with:
context: src/landing/
push: true
tags: |
ghcr.io/agile-waterfall/flooq-landing:latest
ghcr.io/agile-waterfall/flooq-landing:${{ github.event.release.tag_name }}
publish:
runs-on: ubuntu-latest
needs: [buildApi, buildIdentity, buildEditor, buildExecutor, buildLanding]
steps:
- uses: actions/checkout@v2
- uses: azure/k8s-set-context@v2
with:
method: kubeconfig
kubeconfig: ${{ secrets.K8S_FLOOQ_CONFIG }}
context: k8s-flooq
- uses: azure/setup-helm@v1
with:
version: 3.*
- name: Helm Install
run: |
helm dependency update ./.helm-own
helm upgrade --install \
-n prod \
-f ./.helm-own/values-prod.yaml \
--set version=${{ github.event.release.tag_name }} \
--set services.database.host=${{ secrets.PROD_DB_HOST }} \
--set services.database.password=${{ secrets.PROD_DB_PASSWORD }} \
--set auth.github.clientId=${{ secrets.PROD_GITHUB_CLIENT_ID }} \
--set auth.github.clientSecret=${{ secrets.PROD_GITHUB_CLIENT_SECRET }} \
--set auth.next.secret=${{ secrets.PROD_NEXT_SECRET }} \
--set auth.identity.clientId=${{ secrets.PROD_IDENTITY_CLIENT_ID }} \
--set auth.identity.clientSecret=${{ secrets.PROD_IDENTITY_CLIENT_SECRET }} \
--set token.encryption.key=${{ secrets.PROD_TOKEN_ENCRYPTION_KEY }} \
--set token.encryption.iv=${{ secrets.PROD_TOKEN_ENCRYPTION_IV }} \
flooq \
./.helm-own