From 8c82a158914efc56b32bed4cf20f20be142fe0cc Mon Sep 17 00:00:00 2001 From: Jared Trouth Date: Wed, 27 Dec 2023 18:12:32 -0600 Subject: [PATCH] Update workflow --- .github/workflows/build-and-push.yaml | 14 +++++++++----- .github/workflows/deploy-gke.yaml | 8 +++++++- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-and-push.yaml b/.github/workflows/build-and-push.yaml index d3f9ed24..43beec56 100644 --- a/.github/workflows/build-and-push.yaml +++ b/.github/workflows/build-and-push.yaml @@ -22,7 +22,8 @@ jobs: name: Build Container Image runs-on: ubuntu-latest outputs: - deploy_tag: ${{ steps.deploy-tag.outputs.tag }} + deploy_tag: ${{ steps.deploy-tag.outputs.deploy_tag }} + image_name: ${{ steps.deploy-tag.outputs.image_name }} steps: - name: Checkout @@ -52,9 +53,10 @@ jobs: name: Parse deployment tag id: deploy-tag run: | - tag=$(echo "$DOCKER_METADATA_OUTPUT_JSON" | jq -r '.tags[] | select(. | test(":sha-|:v."))') - echo $tag | cut -f2 -d: - echo tag=$(echo $tag | cut -f2 -d:) >> "$GITHUB_OUTPUT" + full_tag=$(echo "$DOCKER_METADATA_OUTPUT_JSON" | jq -r '.tags[] | select(. | test(":sha-|:v."))') + echo $full_tag | cut -f2 -d: + echo deploy_tag=$(echo $full_tag | cut -f2 -d:) >> "$GITHUB_OUTPUT" + echo image_name=$(echo $full_tag | cut -f2 -d:) >> "$GITHUB_OUTPUT" - name: Set up QEMU @@ -109,6 +111,7 @@ jobs: with: environment: prod image_tag: ${{ needs.docker.outputs.deploy_tag }} + image_name: ${{ needs.docker.outputs.image_name }} deploy-int: name: Deploy Int @@ -118,4 +121,5 @@ jobs: if: ${{ github.ref == 'master' || (github.base_ref == 'master') }} with: environment: int - image_tag: ${{ needs.docker.outputs.deploy_tag }} \ No newline at end of file + image_tag: ${{ needs.docker.outputs.deploy_tag }} + image_name: ${{ needs.docker.outputs.image_name }} \ No newline at end of file diff --git a/.github/workflows/deploy-gke.yaml b/.github/workflows/deploy-gke.yaml index 2b72cc83..c8dff679 100644 --- a/.github/workflows/deploy-gke.yaml +++ b/.github/workflows/deploy-gke.yaml @@ -8,10 +8,14 @@ on: type: string required: true image_tag: - description: The API image tag to deploy + description: The container image tag to deploy type: string required: false default: latest + image_name: + description: The repo URL (minus the tag) of the container image to deploy + type: string + required: true preview: description: A boolean indicating if this is a preview deployment type: boolean @@ -49,6 +53,8 @@ jobs: parameters: - name: api.image.tag value: ${{ inputs.image_tag }} + - name: api.image.name + value: $${{ inputs.image_name }} operation: initiatedBy: username: ${{ github.actor }}