Deploy branch environment to EKS #10
Workflow file for this run
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: Deploy To EKS | |
on: | |
workflow_dispatch: | |
permissions: | |
id-token: write | |
contents: read | |
env: | |
EASI_APP_NODE_VERSION: "18.20.4" | |
GIT_HASH: ${{ github.sha }} | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | |
GIT_REF_NAME: ${{ github.ref }} | |
jobs: | |
build_easi-frontend_image: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Configure AWS credentials | |
uses: aws-actions/[email protected] | |
with: | |
role-to-assume: ${{ secrets.AWS_INFRA_OIDC_ROLE_TO_ASSUME }} | |
aws-region: us-west-2 | |
- name: Login to Amazon ECR | |
id: login-ecr | |
uses: aws-actions/amazon-ecr-login@v2 | |
- name: Setup Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Build, tag, and push image to Amazon ECR | |
uses: docker/build-push-action@v6 | |
with: | |
context: . | |
file: Dockerfile.frontend_k8s | |
push: true | |
cache-to: type=gha,mode=max,scope=${{ env.GIT_REF_NAME }}-easi-frontend | |
cache-from: type=gha,scope=${{ env.GIT_REF_NAME }}-easi-frontend | |
tags: ${{ steps.login-ecr.outputs.registry }}/easi-frontend:${{ env.GIT_HASH }} | |
- name: Announce failure | |
if: ${{ failure() }} | |
run: | | |
./scripts/github-action-announce-broken-branch | |
Build_Application_Images: | |
uses: ./.github/workflows/build_application_images.yml | |
secrets: inherit | |
test_k8s_access: | |
needs: [build_easi-frontend_image, Build_Application_Images] | |
runs-on: ubuntu-latest | |
environment: "dev" | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Configure AWS credentials | |
uses: aws-actions/[email protected] | |
with: | |
role-to-assume: ${{ secrets.AWS_OIDC_ROLE_TO_ASSUME }} | |
aws-region: us-west-2 | |
- name: Update kubeconfig | |
run: aws eks update-kubeconfig --name dev-easi-poc-cluster --region us-west-2 | |
- name: Deploy to EKS | |
run: | | |
./scripts/eks_deploy_env.sh -v |