From 3ed76d199c45ecb0c6d2e5f5135a0d5f717fbc9d Mon Sep 17 00:00:00 2001 From: Andy Date: Wed, 30 Jul 2025 22:48:00 +0000 Subject: [PATCH] =?UTF-8?q?chore(workflow):=20=F0=9F=97=91=EF=B8=8F=20Remo?= =?UTF-8?q?ve=20Docker=20build=20and=20publish=20workflow,=20its=20too=20m?= =?UTF-8?q?essy=20at=20the=20moment=20doing=20manual=20builds=20for=20now.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/docker.yml | 99 ------------------------------------ 1 file changed, 99 deletions(-) delete mode 100644 .github/workflows/docker.yml diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml deleted file mode 100644 index 073835d..0000000 --- a/.github/workflows/docker.yml +++ /dev/null @@ -1,99 +0,0 @@ -name: Build and Publish Docker Image - -on: - push: - branches: [main, master] - paths: # run only when this file changed at all - - "unshackle/core/__init__.py" - pull_request: {} # optional – delete if you don’t build on PRs - workflow_dispatch: {} # manual override - -jobs: - detect-version-change: - runs-on: ubuntu-latest - outputs: - changed: ${{ steps.vdiff.outputs.changed }} - version: ${{ steps.vdiff.outputs.version }} - - steps: - - uses: actions/checkout@v4 - with: { fetch-depth: 2 } # we need the previous commit :contentReference[oaicite:1]{index=1} - - - name: Extract & compare version - id: vdiff - shell: bash - run: | - current=$(grep -oP '__version__ = "\K[^"]+' unshackle/core/__init__.py) - prev=$(git show HEAD^:unshackle/core/__init__.py \ - | grep -oP '__version__ = "\K[^"]+' || echo '') - echo "version=$current" >>"$GITHUB_OUTPUT" - echo "changed=$([ "$current" != "$prev" ] && echo true || echo false)" >>"$GITHUB_OUTPUT" - echo "Current=$current Previous=$prev" - - build-and-push: - needs: detect-version-change - if: needs.detect-version-change.outputs.changed == 'true' # only run when bumped :contentReference[oaicite:2]{index=2} - runs-on: ubuntu-latest - permissions: { contents: read, packages: write } - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Extract version from __init__.py - id: version - run: | - VERSION=$(grep -oP '__version__ = "\K[^"]+' unshackle/core/__init__.py) - echo "version=$VERSION" >> $GITHUB_OUTPUT - echo "major_minor=$(echo $VERSION | cut -d. -f1-2)" >> $GITHUB_OUTPUT - echo "major=$(echo $VERSION | cut -d. -f1)" >> $GITHUB_OUTPUT - echo "Extracted version: $VERSION" - - - name: Set up Docker Buildx - 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 }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Extract metadata - id: meta - uses: docker/metadata-action@v5 - with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - tags: | - type=ref,event=branch - type=ref,event=pr - type=semver,pattern={{version}} - type=semver,pattern={{major}}.{{minor}} - type=semver,pattern={{major}} - type=raw,value=latest,enable={{is_default_branch}} - type=raw,value=v${{ steps.version.outputs.version }},enable={{is_default_branch}} - type=raw,value=${{ steps.version.outputs.version }},enable={{is_default_branch}} - type=raw,value=${{ steps.version.outputs.major_minor }},enable={{is_default_branch}} - type=raw,value=${{ steps.version.outputs.major }},enable={{is_default_branch}} - - - name: Show planned tags - run: | - echo "Planning to create the following tags:" - echo "${{ steps.meta.outputs.tags }}" - - - name: Build and push Docker image - uses: docker/build-push-action@v5 - with: - context: . - platforms: linux/amd64,linux/arm64 - push: ${{ github.event_name != 'pull_request' }} - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - cache-from: type=gha - cache-to: type=gha,mode=max - - - name: Test Docker image - if: github.event_name != 'pull_request' - run: | - docker run --rm ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest env check