forked from AOT-Technologies/forms-flow-ai
-
Notifications
You must be signed in to change notification settings - Fork 0
88 lines (77 loc) · 6.13 KB
/
qa-deployment.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
name: Deploy to QA environment
on:
workflow_dispatch:
defaults:
run:
shell: bash
working-directory: .
jobs:
deploy-to-qa:
if: github.repository == 'AOT-Technologies/forms-flow-ai'
runs-on: ubuntu-latest
environment: 'qa'
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v2 # Add this step to check out the repository
- name: Set version
if: ${{ github.ref != 'refs/heads/master' }}
working-directory: .
run: |
VER=$(cat VERSION)
echo "VERSION=$VER" >> $GITHUB_ENV
- name: Set version
if: ${{ github.ref == 'refs/heads/master' }}
working-directory: .
run: |
VER=$(cat VERSION)
VER=${VER/-alpha/''}
echo "VERSION=$VER" >> $GITHUB_ENV
- run: echo ${{ env.VERSION }}
- name: Set up AWS CLI
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_DEPLOYMENT_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_DEPLOYMENT_SECRET_ACCESS_KEY }}
aws-region: ca-central-1 # Change this to your desired region
- name: Install kubectl
run: |
curl -LO "https://dl.k8s.io/release/$(curl -Ls https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
chmod +x kubectl
sudo mv kubectl /usr/local/bin/
- name: Update Kube config
run: aws eks update-kubeconfig --region ca-central-1 --name ${{ secrets.QA_EKS_CLUSTER }}
- name: Deploy to QA
run: |
kubectl -n ${{ secrets.QA_OPENSOURCE_NAMESPACE }} patch deployment forms-flow-api -p '{"spec":{"template":{"spec":{"containers":[{"name":"forms-flow-api","image":"docker.io/formsflow/forms-flow-webapi:${{ env.VERSION }}"}]}}}}'
kubectl -n ${{ secrets.QA_OPENSOURCE_NAMESPACE }} patch deployment forms-flow-bpm -p '{"spec":{"template":{"spec":{"containers":[{"name":"forms-flow-bpm","image":"docker.io/formsflow/forms-flow-bpm:${{ env.VERSION }}"}]}}}}'
kubectl -n ${{ secrets.QA_OPENSOURCE_NAMESPACE }} patch deployment forms-flow-documents-api -p '{"spec":{"template":{"spec":{"containers":[{"name":"forms-flow-documents-api","image":"docker.io/formsflow/forms-flow-documents-api:${{ env.VERSION }}"}]}}}}'
kubectl -n ${{ secrets.QA_OPENSOURCE_NAMESPACE }} patch deployment forms-flow-web -p '{"spec":{"template":{"spec":{"containers":[{"name":"forms-flow-web","image":"docker.io/formsflow/forms-flow-web:${{ env.VERSION }}"}]}}}}'
kubectl rollout restart deployment forms-flow-api -n ${{ secrets.QA_OPENSOURCE_NAMESPACE }}
kubectl rollout restart deployment forms-flow-bpm -n ${{ secrets.QA_OPENSOURCE_NAMESPACE }}
kubectl rollout restart deployment forms-flow-documents-api -n ${{ secrets.QA_OPENSOURCE_NAMESPACE }}
kubectl rollout restart deployment forms-flow-web -n ${{ secrets.QA_OPENSOURCE_NAMESPACE }}
- name: Deploy to QA ee
run: |
kubectl -n ${{ secrets.QA_EE_NAMESPACE }} patch deployment forms-flow-api -p '{"spec":{"template":{"spec":{"containers":[{"name":"forms-flow-api","image":"docker.io/formsflow/forms-flow-webapi-ee:${{ env.VERSION }}"}]}}}}'
kubectl -n ${{ secrets.QA_EE_NAMESPACE }} patch deployment forms-flow-bpm -p '{"spec":{"template":{"spec":{"containers":[{"name":"forms-flow-bpm","image":"docker.io/formsflow/forms-flow-bpm-ee:${{ env.VERSION }}"}]}}}}'
kubectl -n ${{ secrets.QA_EE_NAMESPACE }} patch deployment forms-flow-documents-api -p '{"spec":{"template":{"spec":{"containers":[{"name":"forms-flow-documents-api","image":"docker.io/formsflow/forms-flow-documents-api-ee:${{ env.VERSION }}"}]}}}}'
kubectl -n ${{ secrets.QA_EE_NAMESPACE }} patch deployment forms-flow-web -p '{"spec":{"template":{"spec":{"containers":[{"name":"forms-flow-web","image":"docker.io/formsflow/forms-flow-web-ee:${{ env.VERSION }}"}]}}}}'
kubectl rollout restart deployment forms-flow-api -n ${{ secrets.QA_EE_NAMESPACE }}
kubectl rollout restart deployment forms-flow-bpm -n ${{ secrets.QA_EE_NAMESPACE }}
kubectl rollout restart deployment forms-flow-documents-api -n ${{ secrets.QA_EE_NAMESPACE }}
kubectl rollout restart deployment forms-flow-web -n ${{ secrets.QA_EE_NAMESPACE }}
- name: Deploy to QA multi
run: |
kubectl -n ${{ secrets.QA_EE_MULTITENANT_NAMESPACE }} patch deployment forms-flow-api -p '{"spec":{"template":{"spec":{"containers":[{"name":"forms-flow-api","image":"docker.io/formsflow/forms-flow-webapi-ee:${{ env.VERSION }}"}]}}}}'
kubectl -n ${{ secrets.QA_EE_MULTITENANT_NAMESPACE }} patch deployment forms-flow-bpm -p '{"spec":{"template":{"spec":{"containers":[{"name":"forms-flow-bpm","image":"docker.io/formsflow/forms-flow-bpm-ee:${{ env.VERSION }}"}]}}}}'
kubectl -n ${{ secrets.QA_EE_MULTITENANT_NAMESPACE }} patch deployment forms-flow-documents-api -p '{"spec":{"template":{"spec":{"containers":[{"name":"forms-flow-documents-api","image":"docker.io/formsflow/forms-flow-documents-api-ee:${{ env.VERSION }}"}]}}}}'
kubectl -n ${{ secrets.QA_EE_MULTITENANT_NAMESPACE }} patch deployment forms-flow-web -p '{"spec":{"template":{"spec":{"containers":[{"name":"forms-flow-web","image":"docker.io/formsflow/forms-flow-web-ee:${{ env.VERSION }}"}]}}}}'
kubectl -n ${{ secrets.QA_EE_MULTITENANT_NAMESPACE }} patch deployment forms-flow-admin -p '{"spec":{"template":{"spec":{"containers":[{"name":"forms-flow-admin","image":"docker.io/formsflow/forms-flow-ai-admin:${{ env.VERSION }}"}]}}}}'
kubectl rollout restart deployment forms-flow-api -n ${{ secrets.QA_EE_MULTITENANT_NAMESPACE }}
kubectl rollout restart deployment forms-flow-bpm -n ${{ secrets.QA_EE_MULTITENANT_NAMESPACE }}
kubectl rollout restart deployment forms-flow-documents-api -n ${{ secrets.QA_EE_MULTITENANT_NAMESPACE }}
kubectl rollout restart deployment forms-flow-web -n ${{ secrets.QA_EE_MULTITENANT_NAMESPACE }}
kubectl rollout restart deployment forms-flow-admin -n ${{ secrets.QA_EE_MULTITENANT_NAMESPACE }}