From ee2787a4139f977f632ee7f13e8a12bf0c39d18d Mon Sep 17 00:00:00 2001 From: SunWuyuan Date: Sat, 24 May 2025 17:54:13 +0800 Subject: [PATCH] Refactor Docker publish workflow to remove database matrix strategy, simplifying image building process. Update image tagging to exclude database suffix and adjust conditions for push actions based on event type. --- .github/workflows/docker-publish.yml | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index a475a76..18f8753 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -19,18 +19,6 @@ jobs: contents: read packages: write - strategy: - matrix: - include: - - db: mysql - suffix: -mysql - - db: postgres - suffix: -postgres - - db: sqlite - suffix: -sqlite - - db: sqlite - suffix: "" - steps: - name: Checkout repository uses: actions/checkout@v4 @@ -39,6 +27,7 @@ jobs: uses: docker/setup-buildx-action@v3 - name: Log in to Container registry + if: github.event_name != 'pull_request' uses: docker/login-action@v3 with: registry: ${{ env.REGISTRY }} @@ -49,7 +38,7 @@ jobs: id: meta uses: docker/metadata-action@v5 with: - images: ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.PROJECT_NAME }}${{ matrix.suffix }} + images: ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.PROJECT_NAME }} tags: | type=ref,event=branch type=ref,event=pr @@ -63,8 +52,6 @@ jobs: with: context: . push: ${{ github.event_name != 'pull_request' }} - build-args: | - DATABASE_TYPE=${{ matrix.db }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} cache-from: type=gha