Skip to content

Publish to Docker Hub #21

Publish to Docker Hub

Publish to Docker Hub #21

Workflow file for this run

name: Publish to Docker Hub
on:
workflow_dispatch:
workflow_run:
branches:
- master
workflows:
- Unit tests
types:
- completed
jobs:
publish:
runs-on: ubuntu-latest
name: Publish docker image
if: github.event.workflow_run.conclusion == 'success'
steps:
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Login AWS
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::724178030834:role/capplatform-deploy
aws-access-key-id: ${{ secrets.CAPPLATFORM_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.CAPPLATFORM_AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- name: Login AWS ECR
uses: aws-actions/amazon-ecr-login@v2
with:
registry-type: public
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build and push
uses: docker/build-push-action@v3
with:
push: true
platforms: linux/arm64,linux/amd64
tags: |
mergermarket/cdflow2-build-docker-ecr:latest
public.ecr.aws/p7e3d1i3/cdflow2-build-docker-ecr:latest