Skip to content

feat: update build-image.ym\ #92

feat: update build-image.ym\

feat: update build-image.ym\ #92

Workflow file for this run

name: Build and Push Docker Images
on:
workflow_dispatch:
inputs:
name:
description: "Manual workflow name"
required: true
push:
jobs:
build-and-push:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- arch: amd64
platform: linux/amd64
dockerfile: Dockerfile
- arch: arm64
platform: linux/arm64
dockerfile: Dockerfile
- arch: slim
platform: linux/amd64
dockerfile: Dockerfile.slim
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ env.DOCKER_HUB_USERNAME }}
password: ${{ env.DOCKER_HUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
file: ${{ matrix.dockerfile }}
platforms: ${{ matrix.platform }}
push: true
tags: ${{ env.IMAGE_NAME }}:latest-${{ matrix.arch }}
build-args: |
ARCH=${{ matrix.arch }}
- name: Build and push slim image
if: matrix.arch == 'slim'
uses: docker/build-push-action@v2
with:
file: ${{ matrix.dockerfile }}
platforms: ${{ matrix.platform }}
push: true
tags: ${{ env.IMAGE_NAME }}:latest-slim