-
Notifications
You must be signed in to change notification settings - Fork 11
59 lines (47 loc) · 1.87 KB
/
api-actions.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
name: Push API develop to ECR latest
on:
workflow_dispatch:
push:
paths:
- api/**
- k8s/openclimate-api-deployment.yml
branches: [ "develop" ]
jobs:
pushToECR:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Logging in to ECR
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/openearthfoundation
- name: Pushing OC-API to ECR
env:
VERSION: ${{ github.sha }}
IMAGE: public.ecr.aws/openearthfoundation/openclimate-api
run: |
docker build -t $IMAGE:$VERSION api
docker tag $IMAGE:$VERSION $IMAGE:latest
docker push $IMAGE:$VERSION
docker push $IMAGE:latest
deployToEKS:
needs: pushToECR
runs-on: ubuntu-latest
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID_EKS_DEV_USER }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY_EKS_DEV_USER }}
EKS_DEV_NAME: ${{ secrets.EKS_DEV_NAME }}
steps:
- uses: actions/checkout@v3
- name: Creating kubeconfig file
run: aws eks update-kubeconfig --name ${{secrets.EKS_DEV_NAME}} --region us-east-1
- name: Testing connection to EKS
run: kubectl get pods -n default
- name: Deploying service
run: |
kubectl apply -f k8s/openclimate-api-deployment.yml -n default
kubectl set env deployment/openclimate-ui-deployment WEB_ROOT=https://openclimate.openearth.dev
kubectl set env deployment/openclimate-ui-deployment MATOMO_SITE_ID=1
kubectl set env deployment/openclimate-ui-deployment MATOMO_SERVER=https://matomo.openearth.foundation/
kubectl rollout restart deployment openclimate-api-deployment -n default