Files
iblogs/.github/workflows/publish.yml
Sam Kintop bf3870ccca
Some checks failed
Publish Docker Image / build-and-push (push) Failing after 2m13s
all
2026-04-30 09:44:02 -05:00

66 lines
1.8 KiB
YAML

name: Publish Docker Image
on:
push:
branches:
- 'main'
tags:
- 'v*'
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels)
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
# Branch Name (e.g. 'two', 'main')
type=ref,event=branch
# Full Version (e.g. '1.2.3')
type=semver,pattern={{version}}
# Major Version (e.g. '1')
type=semver,pattern={{major}}
# Major.Minor (e.g. '1.2')
type=semver,pattern={{major}}.{{minor}}
# Latest (Only on release tags)
type=raw,value=latest,enable=${{ startsWith(github.ref, 'refs/tags/v') }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
cache-from: |
type=gha
type=gha,scope=refs/heads/main
cache-to: type=gha,mode=max