Skip to content

Commit 2981ecf

Browse files
committed
CI: push Docker images by digest
1 parent a5084ac commit 2981ecf

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

.github/workflows/docker.yaml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,13 @@ jobs:
3232
run: |
3333
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
3434
35+
- name: Login to Docker Hub
36+
if: github.ref == 'refs/heads/develop' || startsWith(github.ref, 'refs/tags/') || startsWith(github.ref, 'refs/heads/release')
37+
uses: docker/login-action@v3
38+
with:
39+
username: ${{ secrets.DOCKERHUB_USERNAME }}
40+
password: ${{ secrets.DOCKERHUB_TOKEN }}
41+
3542
- name: Set up Docker Buildx
3643
uses: docker/setup-buildx-action@v3
3744

@@ -43,7 +50,7 @@ jobs:
4350
platforms: ${{ matrix.arch.platform }}
4451
cache-from: type=gha
4552
cache-to: type=gha,mode=max
46-
outputs: type=image,name=${{ env.REGISTRY_NODE_IMAGE }},push-by-digest=true,name-canonical=true,push=false
53+
outputs: type=image,name=${{ env.REGISTRY_NODE_IMAGE }},push-by-digest=true,name-canonical=true,push=true
4754

4855
- name: Export digest
4956
run: |
@@ -81,6 +88,13 @@ jobs:
8188
- name: Git checkout
8289
uses: actions/checkout@v5
8390

91+
- name: Login to Docker Hub
92+
if: github.ref == 'refs/heads/develop' || startsWith(github.ref, 'refs/tags/') || startsWith(github.ref, 'refs/heads/release')
93+
uses: docker/login-action@v3
94+
with:
95+
username: ${{ secrets.DOCKERHUB_USERNAME }}
96+
password: ${{ secrets.DOCKERHUB_TOKEN }}
97+
8498
- name: Set up Docker Buildx
8599
uses: docker/setup-buildx-action@v3
86100

@@ -94,7 +108,7 @@ jobs:
94108
BUILD_CONFIGURATION=${{ matrix.configuration.build_configuration }}
95109
cache-from: type=gha
96110
cache-to: type=gha,mode=max
97-
outputs: type=image,name=${{ env.REGISTRY_FRONTEND_IMAGE }},push-by-digest=true,name-canonical=true,push=false
111+
outputs: type=image,name=${{ env.REGISTRY_FRONTEND_IMAGE }},push-by-digest=true,name-canonical=true,push=true
98112

99113
- name: Export digest
100114
run: |

0 commit comments

Comments
 (0)