Files
nsupdate/.gitea/workflows/docker-build-multiarch.yml
Christian Busch c70334e65e
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 3m13s
Updated workflows
2026-02-03 00:44:29 +01:00

61 lines
1.7 KiB
YAML

name: Build and Push Multiarch Docker Image
on:
workflow_dispatch:
# push:
# branches: [main]
# paths-ignore:
# - README.md
# - CHANGELOG.md
# - LICENSE.md
# pull_request:
# branches: [main]
# schedule:
# - cron: '@weekly'
env:
DOCKERFILE: ./docker/Dockerfile
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
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 Container Registry
uses: docker/login-action@v3
with:
registry: ${{ secrets.REGISTRY_URL }}
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ secrets.REGISTRY_URL }}/${{ github.repository }}
tags: |
type=ref,event=branch
type=sha,prefix={{branch}}-
type=raw,value=latest,enable={{is_default_branch}}
type=schedule,pattern={{date 'YYYYMMDD'}}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: ${{ env.DOCKERFILE }}
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=registry,ref=${{ secrets.REGISTRY_URL }}/${{ github.repository }}:buildcache
cache-to: type=registry,ref=${{ secrets.REGISTRY_URL }}/${{ github.repository }}:buildcache,mode=max