Skip to content

Commit

Permalink
pull a certain image tag when going to anywhere but dev
Browse files Browse the repository at this point in the history
  • Loading branch information
CameronRushton committed Sep 25, 2024
1 parent 7c0b3fa commit 487cbad
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/deploy-managed-ema-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on:
workflow_dispatch:
inputs:
releaseVersion:
description: "The tag of the image to push. We'll pull the main image and re-tag it with this."
description: "The tag of the image to push. For dev, we'll pull the 'main' image and for all other environments, we'll pull image A.B.C, then we push the image with tag A.B.C to where it needs to go."
required: true
default: "A.B.C"
deployEnvironment:
Expand All @@ -29,11 +29,18 @@ jobs:
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1.6.0
- name: ECR (Dev) - Pull Image
- name: ECR (Dev) - Pull Main Image
if: ${{ github.event.inputs.deployEnvironment == 'development' }}
run: |
ECR_DEV_IMAGE="${{ steps.login-ecr.outputs.registry }}/${{ github.event.repository.name }}:main"
docker pull $ECR_DEV_IMAGE
echo "ECR_DEV_IMAGE=$ECR_DEV_IMAGE" >> $GITHUB_ENV
- name: ECR (Dev) - Pull Prod Ready Image Tag
if: ${{ github.event.inputs.deployEnvironment != 'development' }}
run: |
ECR_DEV_IMAGE="${{ steps.login-ecr.outputs.registry }}/${{ github.event.repository.name }}:${{ github.event.inputs.releaseVersion }}"
docker pull $ECR_DEV_IMAGE
echo "ECR_DEV_IMAGE=$ECR_DEV_IMAGE" >> $GITHUB_ENV
- name: GCR (Dev) - Login
if: ${{ github.event.inputs.deployEnvironment == 'development' }}
uses: docker/login-action@v3
Expand Down

0 comments on commit 487cbad

Please sign in to comment.