From 65bf15f15327220687be26f572161df22d016e16 Mon Sep 17 00:00:00 2001 From: remsky Date: Sat, 4 Jan 2025 02:50:45 -0700 Subject: [PATCH] ci: update docker workflow to only build on releases --- .github/workflows/docker-publish.yml | 32 +++------------------------- 1 file changed, 3 insertions(+), 29 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index ec5a1ba..5a2b3af 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -2,20 +2,7 @@ name: Docker Build and Publish on: push: - branches: [ "master" ] tags: [ 'v*.*.*' ] - paths: - - '**.py' - - '**/Dockerfile*' - - '**/docker-compose*.yml' - - 'requirements*.txt' - pull_request: - branches: [ "master" ] - paths: - - '**.py' - - '**/Dockerfile*' - - '**/docker-compose*.yml' - - 'requirements*.txt' # Allow manual trigger from GitHub UI workflow_dispatch: @@ -35,7 +22,6 @@ jobs: uses: actions/checkout@v4 - name: Log in to the Container registry - if: github.event_name != 'pull_request' uses: docker/login-action@v3 with: registry: ${{ env.REGISTRY }} @@ -49,13 +35,9 @@ jobs: with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} tags: | - type=raw,value=latest - type=ref,event=branch - type=ref,event=pr type=semver,pattern={{version}} type=semver,pattern={{major}}.{{minor}} type=semver,pattern={{major}} - type=sha # Extract metadata for CPU image - name: Extract metadata (tags, labels) for CPU Docker @@ -66,13 +48,9 @@ jobs: flavor: | suffix=-cpu tags: | - type=raw,value=latest - type=ref,event=branch - type=ref,event=pr type=semver,pattern={{version}} type=semver,pattern={{major}}.{{minor}} type=semver,pattern={{major}} - type=sha # Build and push GPU version - name: Build and push GPU Docker image @@ -80,7 +58,7 @@ jobs: with: context: . file: ./Dockerfile - push: ${{ github.event_name != 'pull_request' }} + push: true tags: ${{ steps.meta-gpu.outputs.tags }} labels: ${{ steps.meta-gpu.outputs.labels }} platforms: linux/amd64 @@ -91,7 +69,7 @@ jobs: with: context: . file: ./Dockerfile.cpu - push: ${{ github.event_name != 'pull_request' }} + push: true tags: ${{ steps.meta-cpu.outputs.tags }} labels: ${{ steps.meta-cpu.outputs.labels }} platforms: linux/amd64 @@ -105,13 +83,9 @@ jobs: flavor: | suffix=-ui tags: | - type=raw,value=latest - type=ref,event=branch - type=ref,event=pr type=semver,pattern={{version}} type=semver,pattern={{major}}.{{minor}} type=semver,pattern={{major}} - type=sha # Build and push UI version - name: Build and push UI Docker image @@ -119,7 +93,7 @@ jobs: with: context: ./ui file: ./ui/Dockerfile - push: ${{ github.event_name != 'pull_request' }} + push: true tags: ${{ steps.meta-ui.outputs.tags }} labels: ${{ steps.meta-ui.outputs.labels }} platforms: linux/amd64