Skip to content

Merge pull request #4 from Imaging-Plaza/enhance #1

Merge pull request #4 from Imaging-Plaza/enhance

Merge pull request #4 from Imaging-Plaza/enhance #1

name: Publish Docker Image to GHCR
on:
push:
branches: [ "main" ]
release:
types: [ published ]
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}
tags: |
# tag with 'latest' on pushes to main
type=raw,value=latest,enable={{is_default_branch}}
# tag with the release version on release creation
type=ref,event=release
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}