Files
Lino Silva 6234f33ebb
Build and publish / build (push) Successful in 3m45s
fix: Multiarch
2026-04-10 23:36:26 +01:00

55 lines
1.6 KiB
YAML

name: Build and publish
run-name: Build docker image and publish to registry
on:
push:
branches:
- 'main'
tags:
- 'v*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: https://github.com/actions/checkout@v4
- name: Set up Docker Buildx
uses: https://github.com/docker/setup-buildx-action@v3
with:
config-inline: |
[registry."gitea.lino.cooking"]
http = true
- name: Log in to Gitea Container Registry
uses: https://github.com/docker/login-action@v3
with:
registry: gitea.lino.cooking
username: lino
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Extract metadata
id: meta
uses: https://github.com/docker/metadata-action@v5
with:
images: gitea.lino.cooking/${{ gitea.repository }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=sha,prefix={{branch}}-
type=raw,value=latest,enable={{is_default_branch}}
- name: Build and push Docker image
uses: https://github.com/docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=registry,ref=gitea.lino.cooking/${{ gitea.repository }}:buildcache
cache-to: type=registry,ref=gitea.lino.cooking/${{ gitea.repository }}:buildcache,mode=max