1
0
mirror of https://github.com/ZeroCatDev/ClassworksKV.git synced 2025-07-01 20:09:23 +00:00

Refactor Docker publish workflow to trigger only on the main branch and reintroduce image tag display step, enhancing clarity in the build process.

This commit is contained in:
SunWuyuan 2025-05-25 08:48:49 +08:00
parent 3179d19a21
commit d5f64c92ec
No known key found for this signature in database
GPG Key ID: A6A54CF66F56BB64

View File

@ -2,10 +2,10 @@ name: Docker Build and Push
on:
push:
branches: [ "main", "develop" ]
tags: [ "v*.*.*" ]
branches: ["main"]
tags: ["v*.*.*"]
pull_request:
branches: [ "main", "develop" ]
branches: ["main"]
workflow_dispatch:
env:
@ -27,9 +27,6 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Show generated image tags
run: echo "${{ steps.meta.outputs.tags }}"
- name: Log in to Container registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
@ -53,6 +50,8 @@ jobs:
flavor: |
latest=auto
- name: Show generated image tags
run: echo "${{ steps.meta.outputs.tags }}"
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
@ -61,4 +60,4 @@ jobs:
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
cache-to: type=gha,mode=max