Merge pull request #30 from makerdao/TECH-3246-resources-optimisation #25
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Docker image and deploy it to Kubernetes cluster | |
on: | |
push: | |
branches: | |
- master | |
permissions: | |
id-token: write | |
contents: read | |
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/chief-keeper | |
DOCKER_IMAGE_TAG: latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
role-to-assume: ${{ secrets.GA_OIDC_EKS_PROD }} | |
role-session-name: ChiefKeeper | |
aws-region: ${{ env.AWS_REGION }} | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- 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/chief-keeper.yaml | |
chart-path: techops-services/common | |
namespace: keepers | |
timeout: 5m0s | |
name: chief-keeper | |
chart-repository: https://techops-services.github.io/helm-charts | |
version: 0.0.14 | |
atomic: true |