Skip to content

Merge pull request #4 from makerdao/TECH-3595-Prod #7

Merge pull request #4 from makerdao/TECH-3595-Prod

Merge pull request #4 from makerdao/TECH-3595-Prod #7

on:
push:
branches:
- main
name: Build Docker image and deploy it to Kubernetes cluster
jobs:
deploy:
name: Build-Deploy
runs-on: ubuntu-latest
environment: production
env:
AWS_REGION: us-east-1
CLUSTER_NAME: maker-prod
DOCKER_IMAGE_REGISTRY: makerdao/vote-breakdown-bot
DOCKER_IMAGE_TAG: latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ env.AWS_REGION }}
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Build, tag, and push image to Dockerhub
id: build-image
run: |
docker build -t ${{ env.DOCKER_IMAGE_REGISTRY }} .
docker tag ${{ env.DOCKER_IMAGE_REGISTRY }} ${{ env.DOCKER_IMAGE_REGISTRY }}:${{ env.DOCKER_IMAGE_TAG }}
docker push ${{ env.DOCKER_IMAGE_REGISTRY }}:${{ env.DOCKER_IMAGE_TAG }}
- name: Deploying app to Kubernetes with Helm
uses: bitovi/[email protected]
with:
values: image.repository=${{ env.DOCKER_IMAGE_REGISTRY }},image.tag=${{ env.DOCKER_IMAGE_TAG }}
cluster-name: ${{ env.CLUSTER_NAME }}
config-files: deploy/production/vote-breakdown-bot.yaml
chart-path: techops-services/common
namespace: discord-bots
timeout: 5m0s
name: vote-breakdown-bot
chart-repository: https://techops-services.github.io/helm-charts
version: 0.0.10
atomic: true