Add Multi-Arch build workflow for github

This commit is contained in:
Reza Behzadan 2025-01-03 11:52:26 -05:00
parent 3dce43f0be
commit a8360b2492

View File

@ -1,4 +1,4 @@
name: Build and Publish Docker Image name: Build and Publish Docker Image (Multi-Arch)
on: on:
release: release:
@ -11,13 +11,15 @@ env:
jobs: jobs:
build-and-publish: build-and-publish:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout the code - name: Checkout code
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Build Docker image - name: Set up QEMU
run: docker build -t ${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }} . uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub - name: Login to Docker Hub
uses: docker/login-action@v2 uses: docker/login-action@v2
@ -25,8 +27,13 @@ jobs:
username: ${{ secrets.DOCKER_HUB_USERNAME }} username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }} password: ${{ secrets.DOCKER_HUB_PASSWORD }}
- name: Push Docker image to Docker Hub - name: Build and push
run: | uses: docker/build-push-action@v5
docker push ${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }} with:
docker tag ${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }} ${{ env.IMAGE_NAME }}:latest context: .
docker push ${{ env.IMAGE_NAME }}:latest platforms: linux/amd64,linux/arm64
push: true
tags: |
${{ env.IMAGE_NAME }}:latest
${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}