ci: only push containers on tag events

This commit is contained in:
Ramon Roche
2025-02-26 19:29:52 -08:00
parent b5993c4ec0
commit c942530825
+4 -2
View File
@@ -32,13 +32,14 @@ jobs:
- name: Login to Docker Hub
uses: docker/login-action@v3
if: github.event_name != 'pull_request'
if: ${{ startsWith(github.ref, 'refs/tags/') }}
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
if: ${{ startsWith(github.ref, 'refs/tags/') }}
with:
registry: ghcr.io
username: ${{ github.actor }}
@@ -89,6 +90,7 @@ jobs:
- name: Push container image
uses: docker/build-push-action@v6
if: ${{ startsWith(github.ref, 'refs/tags/') }}
with:
context: Tools/setup
tags: ${{ steps.meta.outputs.tags }}
@@ -96,6 +98,6 @@ jobs:
platforms: |
linux/amd64
provenance: mode=max
push: ${{ startsWith(github.ref, 'refs/tags/') }}
push: true
cache-from: type=s3,blobs_prefix=cache/${{ github.repository }}/,manifests_prefix=cache/${{ github.repository }}/,region=${{ env.RUNS_ON_AWS_REGION }},bucket=${{ env.RUNS_ON_S3_BUCKET_CACHE }}
cache-to: type=s3,blobs_prefix=cache/${{ github.repository }}/,manifests_prefix=cache/${{ github.repository }}/,region=${{ env.RUNS_ON_AWS_REGION }},bucket=${{ env.RUNS_ON_S3_BUCKET_CACHE }},mode=max