From 3b99c7af9f598d607e3804ffb56239b0edb09abf Mon Sep 17 00:00:00 2001 From: Adam Scarberry <46494851+adamscarberry@users.noreply.github.com> Date: Tue, 5 Nov 2024 10:53:35 -0500 Subject: [PATCH] add ui build workflow, fix other names --- .../cwbi-dev-build-push-migration.yml | 2 +- .../cwbi-dev-build-push-packager.yml | 2 +- .github/workflows/cwbi-dev-build-push-ui.yml | 53 +++++++++++++++++++ 3 files changed, 55 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/cwbi-dev-build-push-ui.yml diff --git a/.github/workflows/cwbi-dev-build-push-migration.yml b/.github/workflows/cwbi-dev-build-push-migration.yml index 4785a17..17596c8 100644 --- a/.github/workflows/cwbi-dev-build-push-migration.yml +++ b/.github/workflows/cwbi-dev-build-push-migration.yml @@ -17,7 +17,7 @@ permissions: id-token: write # This is required for requesting the JWT contents: read # This is required for actions/checkout jobs: - Build-Push-Listener-to-Dev: + Build-Push-Migration-to-Dev: runs-on: ubuntu-latest steps: - name: Git clone the repository diff --git a/.github/workflows/cwbi-dev-build-push-packager.yml b/.github/workflows/cwbi-dev-build-push-packager.yml index c58dd5d..ebd27e8 100644 --- a/.github/workflows/cwbi-dev-build-push-packager.yml +++ b/.github/workflows/cwbi-dev-build-push-packager.yml @@ -17,7 +17,7 @@ permissions: id-token: write # This is required for requesting the JWT contents: read # This is required for actions/checkout jobs: - Build-Push-Listener-to-Dev: + Build-Push-Packager-to-Dev: runs-on: ubuntu-latest steps: - name: Git clone the repository diff --git a/.github/workflows/cwbi-dev-build-push-ui.yml b/.github/workflows/cwbi-dev-build-push-ui.yml new file mode 100644 index 0000000..7b9ac35 --- /dev/null +++ b/.github/workflows/cwbi-dev-build-push-ui.yml @@ -0,0 +1,53 @@ +#This is a basic workflow to help you get started with Actions +name: Build UI Server Image, Push to AWS Dev ECR + +# Controls when the action will run. Invokes the workflow on push events but only for the main branch +on: + push: + branches: [cwbi-dev] + paths: + - .github/workflows/cwbi-dev-build-push-ui.yml + - 'ui/server/**' + +env: + AWS_REGION: aws-us-gov #Change to reflect your Region + +# Permission can be added at job level or workflow level +permissions: + id-token: write # This is required for requesting the JWT + contents: read # This is required for actions/checkout +jobs: + Build-Push-UI-to-Dev: + runs-on: ubuntu-latest + steps: + - name: Git clone the repository + uses: actions/checkout@v4 + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + aws-region: us-gov-west-1 + role-to-assume: arn:aws-us-gov:iam::718787032875:role/github-actions-ecr-cumulus + output-credentials: true + # Hello from AWS: WhoAmI + - name: Sts GetCallerIdentity + run: | + aws sts get-caller-identity + - name: Login to Amazon ECR + id: login-ecr + uses: aws-actions/amazon-ecr-login@v2 + with: + mask-password: 'true' + - name: Build Image; Push to ECR + env: + ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} + ECR_REPOSITORY: cumulus-ui + IMAGE_TAG: latest + run: | + docker build -f ui/server/Dockerfile ui \ + --tag $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG \ + --tag $ECR_REGISTRY/$ECR_REPOSITORY:dev + docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG + docker push $ECR_REGISTRY/$ECR_REPOSITORY:dev + - name: ECR Logout + if: always() + run: docker logout ${{ steps.login-ecr.outputs.registry }}