26
26
merge_group :
27
27
28
28
env :
29
- # Use docker.io for Docker Hub if empty
30
- REGISTRY : ghcr.io
31
29
# github.repository as <account>/<repo>
32
30
IMAGE_NAME : ${{ github.repository }}
33
31
66
64
- name : Checkout repository
67
65
uses : actions/checkout@v4
68
66
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
-
77
67
# Setup QEMU
78
68
# https://github.com/marketplace/actions/docker-setup-buildx#with-qemu
79
69
- name : Setup QEMU
@@ -99,17 +89,25 @@ jobs:
99
89
if : github.event_name != 'pull_request'
100
90
uses : docker/login-action@v3
101
91
with :
102
- registry : ${{ env.REGISTRY }}
92
+ registry : ghcr.io
103
93
username : ${{ github.actor }}
104
94
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 }}
105
101
106
102
# Extract metadata (tags, labels) for Docker
107
103
# https://github.com/docker/metadata-action
108
104
- name : Extract Docker metadata
109
105
id : meta
110
106
uses : docker/metadata-action@v5
111
107
with :
112
- images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
108
+ images : |
109
+ ${{ env.IMAGE_NAME }}
110
+ ghcr.io/${{ env.IMAGE_NAME }}
113
111
flavor : |
114
112
latest=auto
115
113
@@ -133,19 +131,6 @@ jobs:
133
131
cache-from : type=local,src=/tmp/.buildx-cache
134
132
cache-to : type=local,dest=/tmp/.buildx-cache-new,mode=max
135
133
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
-
149
134
# Temp fix
150
135
# https://github.com/docker/build-push-action/issues/252
151
136
# https://github.com/moby/buildkit/issues/1896
0 commit comments