ci : only publish/push docker images daily (#3854)

This commit updates the docker workflow to be triggered on a schedule or
manually.
This commit is contained in:
Daniel Bevenius 2026-06-04 10:30:48 +02:00 committed by GitHub
parent 02d5316af5
commit 12d1828837
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 7 deletions

View File

@ -1,9 +1,10 @@
name: Publish Docker image
on:
push:
branches:
- master
workflow_dispatch: # allows manual triggering
schedule:
# Rebuild daily rather than on every push because it is expensive
- cron: '12 4 * * *'
jobs:
push_to_registry:
@ -57,16 +58,14 @@ jobs:
id: tags
run: |
TAGS="ghcr.io/${{ github.repository }}:${{ matrix.config.tag }}"
if [ "${{ github.event_name }}" == "push" ]; then
TAGS="$TAGS,ghcr.io/${{ github.repository }}:${{ matrix.config.tag }}-${{ env.COMMIT_SHA }}"
fi
TAGS="$TAGS,ghcr.io/${{ github.repository }}:${{ matrix.config.tag }}-${{ env.COMMIT_SHA }}"
echo "tags=$TAGS" >> $GITHUB_OUTPUT
- name: Build and push Docker image (tagged)
uses: docker/build-push-action@v6
with:
context: .
push: ${{ github.event_name == 'push' }}
push: true
platforms: ${{ matrix.config.platform }}
tags: ${{ steps.tags.outputs.tags }}
file: ${{ matrix.config.dockerfile }}