Skip to content

Commit

Permalink
fix: push images to new ECR
Browse files Browse the repository at this point in the history
  • Loading branch information
jvandaal committed Dec 15, 2023
1 parent 927420d commit 1856cbc
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,55 @@ jobs:
# JIRA_PROJECT: GAWR
# JIRA_VERSION: ${{ needs.release.outputs.version }}

push_images:
if: needs.release.outputs.version != 'none'
needs: [ release ]
name: Push images
runs-on: ubuntu-latest
strategy:
matrix:
image: ['api-legacy', 'api-oslo', 'api-crab-import', 'api-extract', 'projections-syndication', 'projector', 'producer', 'producer-snapshot-oslo']
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1-node16
with:
aws-access-key-id: ${{ secrets.VBR_AWS_ACCESS_KEY_ID_DEVOPS }}
aws-secret-access-key: ${{ secrets.VBR_AWS_SECRET_ACCESS_KEY_DEVOPS }}
aws-region: ${{ secrets.VBR_AWS_REGION_PRD }}

- name: Login to Amazon ECR
uses: aws-actions/[email protected]

# Download artifact
- name: Download artifact
uses: actions/download-artifact@v3
continue-on-error: false
with:
name: ${{ matrix.image }}-${{ needs.release.outputs.version }}
path: ~/

# Load artifact
- name: Load artifact
shell: bash
run: |
echo mr-$IMAGE-image.tar
docker image load -i ~/mr-$IMAGE-image.tar
env:
IMAGE: ${{ matrix.image }}

- name: Push artifacts to ECR
shell: bash
run: |
echo $IMAGE:$SEMVER
docker tag $BUILD_DOCKER_REGISTRY_TST/postal-registry/$IMAGE:$SEMVER $BUILD_DOCKER_REGISTRY/postal-registry/$IMAGE:$SEMVER
docker push $BUILD_DOCKER_REGISTRY/postal-registry/$IMAGE:$SEMVER
env:
BUILD_DOCKER_REGISTRY_TST: ${{ secrets.VBR_BUILD_DOCKER_REGISTRY_TST }}
BUILD_DOCKER_REGISTRY: ${{ secrets.VBR_DEVOPS_DOCKER_REGISTRY }}
IMAGE: ${{ matrix.image }}
SEMVER: ${{ needs.release.outputs.version }}
WORKSPACE: ${{ github.workspace }}

push_images_to_test:
if: needs.release.outputs.version != 'none'
needs: [ release ]
Expand Down

0 comments on commit 1856cbc

Please sign in to comment.