Skip to content

Build and Push Docker Image #9

Build and Push Docker Image

Build and Push Docker Image #9

name: Build and Push Docker Image
on:
workflow_dispatch:
inputs:
version:
description: 'Version tag for the Docker image'
required: true
type: string
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ secrets.DOCKER_USERNAME }}/proxy-queue
tags: |
type=raw,value=${{ inputs.version }}
type=raw,value=latest
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64,linux/arm64/v8,linux/386,linux/arm/v5,linux/arm/v7,linux/mips64le,,linux/ppc64le,linux/s390x,windows/amd64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max