forked from openMF/community-app
-
Notifications
You must be signed in to change notification settings - Fork 4
78 lines (58 loc) · 2.77 KB
/
deploy-uc-dev.yaml
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
name: Deploy to United Capital to ECR
on:
push:
branches: [ fiter/africa/dev ]
jobs:
deploy:
name: Deploy image to ECS
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
- uses: kamiazya/setup-graphviz@v1
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_united_cap }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_united_cap }}
aws-region: us-east-2
- id: commit
uses: pr-mpt/actions-commit-hash@v1
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
- name: Build, tag, and push image to Amazon ECR
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
ECR_REPOSITORY: unitedcapitalfrontend
IMAGE_TAG: ${{ steps.commit.outputs.short }}
run: |
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_united_cap }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_united_cap}}
aws-region: us-east-2
- name: installing dependcies
run: |
curl https://baltocdn.com/helm/signing.asc | gpg --dearmor | sudo tee /usr/share/keyrings/helm.gpg > /dev/null
sudo apt-get install apt-transport-https ca-certificates curl --yes
sudo curl -fsSLo /usr/share/keyrings/kubernetes-archive-keyring.gpg https://packages.cloud.google.com/apt/doc/apt-key.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/helm.gpg] https://baltocdn.com/helm/stable/debian/ all main" | sudo tee /etc/apt/sources.list.d/helm-stable-debian.list
echo "deb [signed-by=/usr/share/keyrings/kubernetes-archive-keyring.gpg] https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.list
sudo apt-get update -y
sudo apt-get install helm kubectl -y
- name: updating kubeconfig and helm repo
run: |
aws eks --region us-east-2 update-kubeconfig --name united-capital-dev
helm repo add fiter-apps https://chartmuseum.fiter.io/ --username ${{ secrets.CHARTMUSEUM_USERNAME }} --password ${{ secrets.CHARTMUSEUM_PASSWORD }}
- name: deploy frontend
env:
IMAGE_TAG: ${{ steps.commit.outputs.short }}
run: |
cd helm-uc-dev
kubectl config set-context --current --namespace=application
helm dependency update
helm upgrade -i frontend --set fineract-ui.tag=$IMAGE_TAG .