Skip to content

Commit

Permalink
GitHub Action for DockerHub build and publish #19 (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsanchez556 authored Oct 3, 2024
1 parent 0bd3608 commit 6b8cc8a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ jobs:
env:
DOCKER_HUB: ${{ secrets.DOCKER_LOGIN }}
DOCKER_TAGS: latest
DOCKER_REGISTRY: docker.io
runs-on: ubuntu-22.04
permissions:
id-token: write
Expand Down Expand Up @@ -39,6 +40,7 @@ jobs:
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
registry: ${{ env.DOCKER_REGISTRY }}
username: ${{ secrets.DOCKER_LOGIN }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

Expand All @@ -60,7 +62,7 @@ jobs:
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.DOCKER_HUB }}/${{ matrix.target.name }}
images: ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_HUB }}/${{ matrix.target.name }}
tags: ${{ env.DOCKER_TAGS }}

- name: Build And Push Image
Expand All @@ -74,10 +76,9 @@ jobs:
labels: ${{ steps.meta.outputs.labels }}

- name: Generate artifact attestation
if: github.event.repository.fork == false
uses: actions/attest-build-provenance@v1
with:
subject-name: ${{ secrets.DOCKER_LOGIN }}/${{ matrix.target.name }}
subject-name: ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_HUB }}/${{ matrix.target.name }}
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: true

0 comments on commit 6b8cc8a

Please sign in to comment.