Updated workflows
Some checks failed
Build and Push Docker Image / build-and-push (push) Failing after 25s

This commit is contained in:
2026-02-03 00:40:36 +01:00
parent 4fc8b31cbd
commit d1abe8eba0
3 changed files with 118 additions and 56 deletions

View File

@@ -0,0 +1,58 @@
name: Build and Push 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: ./Dockerfile
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- 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
push: ${{ github.event_name != 'pull_request' }}
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