Skip to content

Commit 6b04149

Browse files
committed
ci: Generate tag and push
1 parent b45d306 commit 6b04149

File tree

1 file changed

+35
-1
lines changed

1 file changed

+35
-1
lines changed

.github/workflows/ci.yml

+35-1
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,13 @@ jobs:
192192
with:
193193
Dockerfile: Dockerfile.www
194194

195+
- name: "Docker metadata"
196+
id: meta
197+
uses: docker/metadata-actio@v4
198+
with:
199+
tags: |
200+
type=sha
201+
195202
- name: "Build nipapd Docker image"
196203
uses: docker/build-push-action@v5
197204
with:
@@ -207,7 +214,7 @@ jobs:
207214
context: .
208215
file: ./Dockerfile.www
209216
load: true
210-
tags: ${{ env.WWW_CI_TAG }}
217+
tags: ${{ env.WWW_CI_TAG }} ${{ steps.meta.outputs.tags }}
211218
push: false
212219

213220
- name: "Setup Docker test"
@@ -247,3 +254,30 @@ jobs:
247254
nosetests3 tests/nipaptest.py
248255
nosetests3 tests/test_nipap_ro.py
249256
nosetests3 tests/test_rest.py
257+
258+
- name: "Login to Docker Hub"
259+
if: ${{ github.ref_name == 'master' }}
260+
uses: docker/login-action@v3
261+
with:
262+
username: ${{ secrets.DOCKERHUB_USERNAME }}
263+
password: ${{ secrets.DOCKERHUB_TOKEN }}
264+
265+
- name: "Build and push nipapd Docker image"
266+
if: ${{ github.ref_name == 'master' }}
267+
uses: docker/build-push-action@v5
268+
with:
269+
context: .
270+
file: ./Dockerfile.nipapd
271+
load: true
272+
tags: ${{ steps.meta.outputs.tags }}
273+
push: true
274+
275+
- name: "Build www Docker image"
276+
if: ${{ github.ref_name == 'master' }}
277+
uses: docker/build-push-action@v5
278+
with:
279+
context: .
280+
file: ./Dockerfile.www
281+
load: true
282+
tags: ${{ steps.meta.outputs.tags }}
283+
push: true

0 commit comments

Comments
 (0)