From c008389a989d6ffcb9268e1ea0f6a1ac20610c97 Mon Sep 17 00:00:00 2001 From: Mitch Dawson Date: Thu, 13 Jun 2024 13:11:30 +0100 Subject: [PATCH 1/2] add replaces vars with inputs --- .github/workflows/deploy-generic.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-generic.yml b/.github/workflows/deploy-generic.yml index 8d8b398b..bee2d233 100644 --- a/.github/workflows/deploy-generic.yml +++ b/.github/workflows/deploy-generic.yml @@ -58,7 +58,7 @@ jobs: - uses: aws-actions/configure-aws-credentials@v4 with: role-to-assume: ${{ secrets.ECR_ROLE_TO_ASSUME }} - aws-region: ${{ vars.ECR_REGION }} + aws-region: ${{ inputs.ECR_REGION }} - name: Login to ECR id: login-to-ecr From 85d1cfb6cf8d67222b4bc6c2d785b9a821f49283 Mon Sep 17 00:00:00 2001 From: Mitch Dawson Date: Thu, 13 Jun 2024 14:12:12 +0100 Subject: [PATCH 2/2] Remove inputs and pull vars from respective environements --- .github/workflows/deploy-generic.yml | 16 ++++------------ .github/workflows/deploy.yml | 6 ------ .github/workflows/test-and-deploy.yml | 2 -- 3 files changed, 4 insertions(+), 20 deletions(-) diff --git a/.github/workflows/deploy-generic.yml b/.github/workflows/deploy-generic.yml index bee2d233..160d8e7c 100644 --- a/.github/workflows/deploy-generic.yml +++ b/.github/workflows/deploy-generic.yml @@ -7,14 +7,6 @@ on: description: "which environment to deploy to" required: true type: string - ecr_repository: - description: "ecr repo to hold container image" - required: true - type: string - ecr_region: - description: "ecr region to hold container image" - required: true - type: string secrets: kube_namespace: description: "the kubernetes namespace to deploy to" @@ -58,7 +50,7 @@ jobs: - uses: aws-actions/configure-aws-credentials@v4 with: role-to-assume: ${{ secrets.ECR_ROLE_TO_ASSUME }} - aws-region: ${{ inputs.ECR_REGION }} + aws-region: ${{ vars.ECR_REGION }} - name: Login to ECR id: login-to-ecr @@ -68,7 +60,7 @@ jobs: id: build-docker-image env: REGISTRY: ${{ steps.login-to-ecr.outputs.registry }} - REPOSITORY: ${{ inputs.ECR_REPOSITORY }} + REPOSITORY: ${{ vars.ECR_REPOSITORY }} IMAGE_TAG: ${{ github.sha }} run: docker build -t $REGISTRY/$REPOSITORY:$IMAGE_TAG . @@ -76,7 +68,7 @@ jobs: id: push-docker-image-to-ecr env: REGISTRY: ${{ steps.login-to-ecr.outputs.registry }} - REPOSITORY: ${{ inputs.ECR_REPOSITORY }} + REPOSITORY: ${{ vars.ECR_REPOSITORY }} IMAGE_TAG: ${{ github.sha }} run: docker push $REGISTRY/$REPOSITORY:$IMAGE_TAG @@ -93,7 +85,7 @@ jobs: CATALOGUE_TOKEN: ${{ secrets.CATALOGUE_TOKEN }} IMAGE_TAG: ${{ github.sha }} REGISTRY: ${{ steps.login-to-ecr.outputs.registry }} - REPOSITORY: ${{ inputs.ECR_REPOSITORY }} + REPOSITORY: ${{ vars.ECR_REPOSITORY }} NAMESPACE: ${{ secrets.KUBE_NAMESPACE }} ENABLE_ANALYTICS: ${{ vars.ENABLE_ANALYTICS }} ANALYTICS_ID: ${{ vars.ANALYTICS_ID }} diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 2bb75ee5..4e706361 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -9,8 +9,6 @@ jobs: uses: "./.github/workflows/deploy-generic.yml" with: env: "dev" - ecr_repository: ${{ vars.DEV_ECR_REPOSITORY }} - ecr_region: ${{ vars.DEV_ECR_REGION }} secrets: kube_namespace: ${{ secrets.KUBE_NAMESPACE }} kube_cert: ${{ secrets.KUBE_CERT }} @@ -28,8 +26,6 @@ jobs: needs: dev with: env: "test" - ecr_repository: ${{ vars.TEST_ECR_REPOSITORY }} - ecr_region: ${{ vars.TEST_ECR_REGION }} secrets: kube_namespace: ${{ secrets.KUBE_NAMESPACE }} kube_cert: ${{ secrets.KUBE_CERT }} @@ -46,8 +42,6 @@ jobs: needs: test with: env: "preprod" - ecr_repository: ${{ vars.PREPROD_ECR_REPOSITORY }} - ecr_region: ${{ vars.PREPROD_ECR_REGION }} secrets: kube_namespace: ${{ secrets.KUBE_NAMESPACE }} kube_cert: ${{ secrets.KUBE_CERT }} diff --git a/.github/workflows/test-and-deploy.yml b/.github/workflows/test-and-deploy.yml index c544bf3b..95cd380e 100644 --- a/.github/workflows/test-and-deploy.yml +++ b/.github/workflows/test-and-deploy.yml @@ -115,8 +115,6 @@ jobs: uses: "./.github/workflows/deploy-generic.yml" with: env: "dev" - ecr_repository: ${{ vars.DEV_ECR_REPOSITORY }} - ecr_region: ${{ vars.DEV_ECR_REGION }} secrets: kube_namespace: ${{ secrets.KUBE_NAMESPACE }} kube_cert: ${{ secrets.KUBE_CERT }}