Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DAT-14708 #231

Merged
merged 17 commits into from
Jul 11, 2023
39 changes: 14 additions & 25 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,36 +109,25 @@ jobs:
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}


- name: Login to ECR Registry
uses: docker/login-action@v2
env:
AWS_REGION: us-east-1
with:
registry: public.ecr.aws
username: ${{ secrets.PUBLIC_ECR_ACCESS_KEY_ID }}
password: ${{ secrets.PUBLIC_ECR_SECRET_ACCESS_KEY }}

- name: Build and Push Docker Image
env:
ECR_REGISTRY: public.ecr.aws/liquibase/docker
uses: docker/build-push-action@v4
with:
context: .
file: ${{ matrix.image.dockerfile }}
no-cache: true
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ matrix.image.name }}:latest${{ matrix.image.suffix }},${{ matrix.image.name }}:${{ steps.collect-data.outputs.extensionVersion }}${{ matrix.image.suffix }},${{ matrix.image.name }}:${{ steps.collect-data.outputs.minorVersion }}${{ matrix.image.suffix }}

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ secrets.PUBLIC_ECR_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.PUBLIC_ECR_SECRET_ACCESS_KEY }}
aws-region: us-east-1

- name: Login to Amazon ECR Public
id: login-ecr-public
uses: aws-actions/amazon-ecr-login@v1
with:
registry-type: public

- name: Build, tag, and push docker image to Amazon ECR Public
env:
REGISTRY: ${{ steps.login-ecr-public.outputs.registry }}
REGISTRY_ALIAS: liquibase # verification of the alias takes a few days
REPOSITORY: docker
IMAGE_TAG: ${{ matrix.image.name }}:latest${{ matrix.image.suffix }},${{ matrix.image.name }}:${{ steps.collect-data.outputs.extensionVersion }}${{ matrix.image.suffix }},${{ matrix.image.name }}:${{ steps.collect-data.outputs.minorVersion }}${{ matrix.image.suffix }}
run: |
docker build -t $REGISTRY/$REGISTRY_ALIAS/$REPOSITORY:$IMAGE_TAG .
docker push $REGISTRY/$REGISTRY_ALIAS/$REPOSITORY:$IMAGE_TAG
tags: ${{ matrix.image.name }}:latest${{ matrix.image.suffix }},${{ matrix.image.name }}:${{ steps.collect-data.outputs.extensionVersion }}${{ matrix.image.suffix }},${{ matrix.image.name }}:${{ steps.collect-data.outputs.minorVersion }}${{ matrix.image.suffix }},${{ env.ECR_REGISTRY }}:latest${{ matrix.image.suffix }},${{ env.ECR_REGISTRY }}:${{ steps.collect-data.outputs.extensionVersion }}${{ matrix.image.suffix }},${{ env.ECR_REGISTRY }}:${{ steps.collect-data.outputs.minorVersion }}${{ matrix.image.suffix }}