Skip to content

chore: move next.config.js to next.config.mjs to work as module #10

chore: move next.config.js to next.config.mjs to work as module

chore: move next.config.js to next.config.mjs to work as module #10

Workflow file for this run

name: Push Web app to GHCR and deploy to EKS
on:
workflow_dispatch:
push:
paths:
- app/**
- k8s/cc-web-deploy.yml
- k8s/cc-web.yml
branches: [ "develop" ]
jobs:
runTests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: npm install
- name: Set up database
run: |
docker run --name github_action_postgresql -d -p 5432:5432 -e POSTGRES_PASSWORD=postgres postgres
createuser -h localhost -p 5432 -U postgres citycatalyst
createdb -h localhost -p 5432 -U postgres citycatalyst -O citycatalyst
DATABASE_HOST=localhost DATABASE_NAME=citycatalyst DATABASE_USERNAME=citycatalyst DATABASE_PASSWORD= npm run db:migrate
- name: Run tests
run: DATABASE_HOST=localhost DATABASE_NAME=citycatalyst DATABASE_USERNAME=citycatalyst DATABASE_PASSWORD= npm run test
- name: Shut down database
run: docker stop github_action_postgresql
pushToGHCR:
needs: runTests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Pushing CC Web to GHCR
env:
VERSION: ${{ github.sha }}
IMAGE: ghcr.io/open-earth-foundation/citycatalyst
run: |
docker build -t $IMAGE:$VERSION app
docker tag $IMAGE:$VERSION $IMAGE:latest
docker push $IMAGE:$VERSION
docker push $IMAGE:latest
deployToEKS:
needs: pushToGHCR
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/cc-web-deploy.yml -n default
kubectl rollout restart deployment cc-web-deploy -n default