Skip to content

Commit 3032104

Browse files
committed
devops: fixed the auto-push-docker workflow, correct docker hub
1 parent cc98ec8 commit 3032104

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

.github/workflows/push-docker.yml

+10-2
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,24 @@ jobs:
2424
uses: actions/checkout@v4
2525

2626
- name: Login to Docker Hub
27-
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
27+
uses: docker/login-action@v3
2828
with:
2929
username: ${{ secrets.DOCKER_USERNAME }}
3030
password: ${{ secrets.DOCKER_PASSWORD }}
3131

32+
- name: Docker metadata
33+
id: metadata
34+
uses: docker/metadata-action@v3
35+
with:
36+
images: ${{ env.IMG_NAME }}
37+
tags: |
38+
type=raw,value={{sha}},enable=${{ github.ref_type != 'tag' }}
39+
3240
- name: Build and push Docker image
3341
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
3442
with:
3543
context: search/
3644
file: ./Dockerfile
3745
push: true
38-
tags: ${{ vars.GITHUB_SHA }}
46+
labels: ${{ steps.meta.outputs.tags }}
3947
labels: ${{ steps.meta.outputs.labels }}

0 commit comments

Comments
 (0)