Skip to content

Merge branch 'develop' of github.com:Open-Earth-Foundation/OpenClimate #19

Merge branch 'develop' of github.com:Open-Earth-Foundation/OpenClimate

Merge branch 'develop' of github.com:Open-Earth-Foundation/OpenClimate #19

Workflow file for this run

name: Push UI main to ECR stable
on:
workflow_dispatch:
push:
paths:
- ui/**
- k8s/prod/openclimate-ui-deployment.yml
branches: [ "main" ]
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-UI to ECR
env:
SHA: ${{ github.sha }}
IMAGE: public.ecr.aws/openearthfoundation/openclimate-ui
run: |
export VERSION=`node -pe "require('./ui/package.json').version"`
export MAJOR=${VERSION%.*.*}
export MINOR=${VERSION%.*}
echo Version: ${VERSION} Major: ${MAJOR} Minor: ${MINOR}
docker build -t $IMAGE:$SHA ui
docker tag $IMAGE:$SHA $IMAGE:$VERSION
docker tag $IMAGE:$SHA $IMAGE:$MAJOR
docker tag $IMAGE:$SHA $IMAGE:$MINOR
docker tag $IMAGE:$SHA $IMAGE:stable
docker push $IMAGE:$SHA
docker push $IMAGE:$VERSION
docker push $IMAGE:$MAJOR
docker push $IMAGE:$MINOR
docker push $IMAGE:stable
deployToEKS:
needs: pushToECR
runs-on: ubuntu-latest
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID_EKS_PROD_USER }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY_EKS_PROD_USER }}
steps:
- uses: actions/checkout@v3
- name: Creating kubeconfig file
run: aws eks update-kubeconfig --name ${{secrets.EKS_PROD_NAME}} --region us-east-1
- name: Testing connection to EKS
run: kubectl get pods -n default
- name: Deploying service
run: |
kubectl apply -f k8s/prod/openclimate-ui-deployment.yml -n default
kubectl set env deployment/openclimate-ui-deployment WEB_ROOT=https://app.openclimate.network
kubectl set env deployment/openclimate-ui-deployment MATOMO_SITE_ID=3
kubectl set env deployment/openclimate-ui-deployment MATOMO_SERVER=https://matomo.openearth.foundation/
kubectl rollout restart deployment openclimate-ui-deployment -n default