Skip to content

[WIP] trying out ECR #3

[WIP] trying out ECR

[WIP] trying out ECR #3

name: release-to-dockerhub
on:
workflow_dispatch:
pull_request:
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
env:
REGISTRY_IMAGE: public.ecr.aws/f8p9h8d2/mobilecoind
jobs:
docker:
runs-on: [ "ubuntu-latest-m" ]
strategy:
matrix:
network: ["test", "prod"]
steps:
- name: Show ref
run: |
echo "Ref is ${{ github.ref_name }}"
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ secrets.AWS_ECR_ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.AWS_ECR_ACCESS_KEY_SECRET }}
aws-region: us-west-2
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
with:
mask-password: true
registry-type: public
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY_IMAGE }}-${{ matrix.network }}
- name: Print tags
run: |
echo "Tags: ${{ steps.meta.outputs.tags }}"
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
provenance: false # needed for AWS ECR
build-args: |
NETWORK=${{ matrix.network }}.mobilecoin.com