From 8814782de02a037db6dbad3205a34a283147b303 Mon Sep 17 00:00:00 2001 From: Michael Fyffe <6224270+TraGicCode@users.noreply.github.com> Date: Mon, 17 Nov 2025 11:38:06 -0600 Subject: [PATCH] (GH-27) Publish image to docker hub Closes #27 --- .github/workflows/docker_build.yml | 33 +++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker_build.yml b/.github/workflows/docker_build.yml index 7be14c8..5cc0a1d 100644 --- a/.github/workflows/docker_build.yml +++ b/.github/workflows/docker_build.yml @@ -1,4 +1,4 @@ -name: Build Docker Image +name: Build and Publish Docker Image on: workflow_call: @@ -18,5 +18,32 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - - name: Build Docker image - run: docker build -f ./src/BuslyCLI.Console/Dockerfile -t busly-cli . + + - name: Log in to Docker Hub + uses: docker/login-action@v3 + with: + username: tragiccode + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v5 + with: + images: tragiccode/busly-cli + + - name: Build and push Docker image + id: push + uses: docker/build-push-action@v6 + with: + context: . + file: ./src/BuslyCLI.Console/Dockerfile + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + + - name: Generate artifact attestation + uses: actions/attest-build-provenance@v3 + with: + subject-name: index.docker.io/tragiccode/busly-cli + subject-digest: ${{ steps.push.outputs.digest }} + push-to-registry: true