Skip to content

Update Docker Build and Push action for ARM #42

Update Docker Build and Push action for ARM

Update Docker Build and Push action for ARM #42

name: Build crAPI identity service
on:
pull_request:
paths:
- '.github/workflows/build-and-release-crapi-identity.yml'
- 'crAPI/services/identity/**'
push:
paths:
- '.github/workflows/build-and-release-crapi-identity.yml'
- 'crAPI/services/identity/**'
branches:
- main
tags:
- v*
workflow_dispatch:
jobs:
build-and-push-image:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: ./crAPI/services/identity
platforms: linux/amd64,linux/arm64
push: true
tags: levoai/crapi-identity:latest
cache-from: type=registry,ref=levoai/crapi-identity-cache
cache-to: type=registry,ref=levoai/crapi-identity-cache,mode=max