Skip to content

Build and Publish Image #7

Build and Publish Image

Build and Publish Image #7

Workflow file for this run

name: Build and Publish Image
on:
workflow_dispatch: {}
jobs:
build_image:
name: Build Docker Image
if: github.repository_owner == 'avaraline'
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to the container registry
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Extract metadata for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ github.repository }}
tags: |
type=edge,branch=main
type=pep440,pattern={{version}},enable=${{ github.ref_type == 'tag' }}
type=pep440,pattern={{major}}.{{minor}},enable=${{ github.ref_type == 'tag' }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: docker/Dockerfile
push: true
platforms: "linux/amd64,linux/arm64"
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}