Skip to content

add gha workflow

add gha workflow #2

Workflow file for this run

name: push_image
on:
push:
# this should be release tags
branches:
- master
env:
REGISTRY: docker.io
DOCKER_USERNAME: ${{ vars.HUB_USERNAME }}
DOCKER_IMAGE: ecs-service-deployer
DOCKER_IMAGE_TAG: latest
jobs:
push_image:
strategy:
matrix:
platform: [ linux/amd64, linux/arm64 ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: ${{ env.PLATFORMS }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
platforms: ${{ matrix.platform }}
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ env.DOCKER_USERNAME }}
password: ${{ secrets.HUB_PASSWORD }}
- name: Build and push
uses: docker/build-push-action@v4
with:
platforms: ${{ matrix.platform }}
context: .
push: true
file: ./build/lambda.Dockerfile
tags: ${{ env.DOCKER_USERNAME }}/${{ env.DOCKER_IMAGE }}:${{ env.DOCKER_IMAGE_TAG }}
cache-from: type=gha,scope=$GITHUB_REF_NAME-${{ matrix.platform }}
cache-to: type=gha,mode=max,scope=$GITHUB_REF_NAME-${{ matrix.platform }}