Compare commits

...

2 Commits

Author SHA1 Message Date
veronoicc edd8b94d00 Only build container image on push to main 2024-05-14 17:24:16 +02:00
veronoicc 598b1b2986 Add newline at the end of docker workflow 2024-05-14 17:24:00 +02:00
1 changed files with 7 additions and 4 deletions

View File

@ -1,5 +1,9 @@
name: build-docker
on: [push, pull_request, workflow_dispatch]
on:
workflow_dispatch:
push:
branches:
- main
env:
REGISTRY: ghcr.io
@ -7,7 +11,6 @@ env:
jobs:
build:
runs-on: ubuntu-22.04
if: ${{ github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
@ -24,7 +27,7 @@ jobs:
uses: docker/metadata-action@v5
with:
tags: |
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }}
type=raw,value=latest
type=sha
images: ${{ env.REGISTRY }}/${{ github.repository }}
- name: Build and push Docker image
@ -36,4 +39,4 @@ jobs:
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max
cache-to: type=gha,mode=max