Skip to content

Commit adde687

Browse files
committed
Try publish to docker hub
1 parent 250351f commit adde687

File tree

1 file changed

+10
-25
lines changed

1 file changed

+10
-25
lines changed

.github/workflows/docker-publish.yml

+10-25
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ on:
2626
merge_group:
2727

2828
env:
29-
# Use docker.io for Docker Hub if empty
30-
REGISTRY: ghcr.io
3129
# github.repository as <account>/<repo>
3230
IMAGE_NAME: ${{ github.repository }}
3331

@@ -66,14 +64,6 @@ jobs:
6664
- name: Checkout repository
6765
uses: actions/checkout@v4
6866

69-
# Install the cosign tool except on PR
70-
# https://github.com/sigstore/cosign-installer
71-
- name: Install cosign
72-
if: github.event_name != 'pull_request'
73-
uses: sigstore/cosign-installer@main
74-
with:
75-
cosign-release: 'v1.13.1' # optional
76-
7767
# Setup QEMU
7868
# https://github.com/marketplace/actions/docker-setup-buildx#with-qemu
7969
- name: Setup QEMU
@@ -99,17 +89,25 @@ jobs:
9989
if: github.event_name != 'pull_request'
10090
uses: docker/login-action@v3
10191
with:
102-
registry: ${{ env.REGISTRY }}
92+
registry: ghcr.io
10393
username: ${{ github.actor }}
10494
password: ${{ secrets.GITHUB_TOKEN }}
95+
- name: Login to Docker Hub
96+
if: github.event_name != 'pull_request'
97+
uses: docker/login-action@v3
98+
with:
99+
username: ${{ secrets.DOCKERHUB_USERNAME }}
100+
password: ${{ secrets.DOCKERHUB_TOKEN }}
105101

106102
# Extract metadata (tags, labels) for Docker
107103
# https://github.com/docker/metadata-action
108104
- name: Extract Docker metadata
109105
id: meta
110106
uses: docker/metadata-action@v5
111107
with:
112-
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
108+
images: |
109+
${{ env.IMAGE_NAME }}
110+
ghcr.io/${{ env.IMAGE_NAME }}
113111
flavor: |
114112
latest=auto
115113
@@ -133,19 +131,6 @@ jobs:
133131
cache-from: type=local,src=/tmp/.buildx-cache
134132
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
135133

136-
# Sign the resulting Docker image digest except on PRs.
137-
# This will only write to the public Rekor transparency log when the Docker
138-
# repository is public to avoid leaking data. If you would like to publish
139-
# transparency data even for private images, pass --force to cosign below.
140-
# https://github.com/sigstore/cosign
141-
# - name: Sign the published Docker image
142-
# if: ${{ github.event_name != 'pull_request' }}
143-
# env:
144-
# COSIGN_EXPERIMENTAL: "true"
145-
# # This step uses the identity token to provision an ephemeral certificate
146-
# # against the sigstore community Fulcio instance.
147-
# run: echo "${{ steps.meta.outputs.tags }}" | xargs -I {} cosign sign {}@${{ steps.build-and-push.outputs.digest }}
148-
149134
# Temp fix
150135
# https://github.com/docker/build-push-action/issues/252
151136
# https://github.com/moby/buildkit/issues/1896

0 commit comments

Comments
 (0)