Skip to content

Commit

Permalink
Push docker image to both dockerhub and ECR
Browse files Browse the repository at this point in the history
  • Loading branch information
EmilKWarmdahl committed Dec 20, 2024
1 parent 12bc262 commit 5c46384
Showing 1 changed file with 18 additions and 13 deletions.
31 changes: 18 additions & 13 deletions .github/workflows/release-dapp-wccd.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
on:
push:
# branches:
# - lma/release/wccd
tags:
- dapp-wccd/mainnet-*
- dapp-wccd/testnet-*
Expand Down Expand Up @@ -34,6 +36,7 @@ jobs:
SERVICE_TAG=${TAG##${{ env.SERVICE_NAME }}/}
IFS='-' read -r ENVIRONMENT TAG_VERSION <<< "$SERVICE_TAG"
echo "FULL_IMAGE_TAG=concordium/${{ env.SERVICE_NAME }}:${TAG_VERSION}" >> $GITHUB_ENV
echo "ECR_IMAGE_TAG=192549843005.dkr.ecr.eu-west-1.amazonaws.com/concordium/${{ inputs.SERVICE_NAME }}:${TAG_VERSION}" >> $GITHUB_ENV
echo "ENVIRONMENT=$ENVIRONMENT" >> $GITHUB_ENV
- name: Check if image exist
Expand All @@ -46,26 +49,28 @@ jobs:
exit 1
fi
- name: Build and push docker mage
- name: Build and push docker image
if: ${{ secrets.DOCKERHUB_TOKEN }}
uses: docker/build-push-action@v6
with:
context: ./examples/wCCD
file: ./examples/wCCD/Dockerfile
tags: ${{ env.FULL_IMAGE_TAG }}
tags: |
${{ env.FULL_IMAGE_TAG }}
${{ env.ECR_IMAGE_TAG }}
no-cache: true
push: true
push: false
build-args: |
NETWORK=${{ env.ENVIRONMENT }}
build_image=${{ env.base_image }}
- name: Build and push Docker to ecr
if: ${{ inputs.AWS_ROLE }}
uses: explosion/action-ecr-publish@v1
with:
dockerfile: examples/wCCD/Dockerfile
platforms: "linux/amd64"
aws_region: "eu-west-1"
aws_role_to_assume: ${{ inputs.AWS_ROLE }}
aws_account_id: "192549843005"
ecr_repo_name: "192549843005.dkr.ecr.eu-west-1.amazonaws.com/concordium/${{ inputs.SERVICE_NAME }}"
# - name: Build and push Docker to ecr
# if: ${{ inputs.AWS_ROLE }}
# uses: explosion/action-ecr-publish@v1
# with:
# dockerfile: examples/wCCD/Dockerfile
# platforms: "linux/amd64"
# aws_region: "eu-west-1"
# aws_role_to_assume: ${{ inputs.AWS_ROLE }}
# aws_account_id: "192549843005"
# ecr_repo_name: "192549843005.dkr.ecr.eu-west-1.amazonaws.com/concordium/${{ inputs.SERVICE_NAME }}"

0 comments on commit 5c46384

Please sign in to comment.