File tree Expand file tree Collapse file tree 5 files changed +23
-7
lines changed Expand file tree Collapse file tree 5 files changed +23
-7
lines changed Original file line number Diff line number Diff line change 1- name : Publish Docker image
1+ name : Publish Docker image (DockerHub)
22
33on :
44 push :
99 IMAGE_NAME : ${{ github.event.repository.name }}
1010
1111jobs :
12- push_to_registry :
12+ push_to_registry_dockerhub :
1313 name : Push Docker image to Docker Hub
1414 runs-on : ubuntu-latest
1515 steps :
@@ -26,13 +26,14 @@ jobs:
2626 id : meta
2727 uses : docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
2828 with :
29+ tags : type=raw,value=latest
2930 images : ${{ env.NAMESPACE }}/${{ env.IMAGE_NAME }}
3031
3132 - name : Build and push Docker image
3233 uses : docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
3334 with :
3435 context : .
35- file : ./ Dockerfile
36+ file : Dockerfile
3637 push : true
3738 tags : ${{ steps.meta.outputs.tags }}
3839 labels : ${{ steps.meta.outputs.labels }}
Original file line number Diff line number Diff line change 1- name : Create and publish a Docker image
1+ name : Publish Docker image (GHRC)
22
33on :
44 push :
77env :
88 REGISTRY : ghcr.io
99 IMAGE_NAME : ${{ github.repository }}
10+ USERNAME : ${{ github.actor }}
1011
1112jobs :
12- build-and-push-image :
13+ push_to_registry_ghrc :
1314 runs-on : ubuntu-latest
1415 permissions :
1516 contents : read
@@ -22,19 +23,21 @@ jobs:
2223 uses : docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
2324 with :
2425 registry : ${{ env.REGISTRY }}
25- username : ${{ github.actor }}
26+ username : ${{ env.USERNAME }}
2627 password : ${{ secrets.TOKEN }}
2728
2829 - name : Extract metadata (tags, labels) for Docker
2930 id : meta
3031 uses : docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
3132 with :
32- images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
33+ tags : type=raw,value=latest
34+ images : ${{ env.REGISTRY }}/${{ env.USERNAME }}/${{ env.IMAGE_NAME }}
3335
3436 - name : Build and push Docker image
3537 uses : docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
3638 with :
3739 context : .
40+ file : Dockerfile
3841 push : true
3942 tags : ${{ steps.meta.outputs.tags }}
4043 labels : ${{ steps.meta.outputs.labels }}
Original file line number Diff line number Diff line change 144144# End of https://www.toptal.com/developers/gitignore/api/node
145145
146146* .db
147+
148+ * .secrets
Original file line number Diff line number Diff line change 1+ {
2+ "cSpell.words" : [
3+ " DOCKERHUB" ,
4+ " ghrc" ,
5+ " github"
6+ ]
7+ }
Original file line number Diff line number Diff line change @@ -7,6 +7,9 @@ https://github.com/Dpbm/coderchallenge-dsin-2023/assets/75098594/5019fba6-dab3-4
77
88
99
10+ ![ DockerHub workflow] ( https://github.com/Dpbm/coderchallenge-dsin-2023/actions/workflows/dockerhub.yml/badge.svg )
11+ ![ GHRC workflow] ( https://github.com/Dpbm/coderchallenge-dsin-2023/actions/workflows/ghrc.yml/badge.svg )
12+
1013
1114Nesse repositório, você encontrará a minha versão do segundo desafio do ` DSIN Coderchallenge 2023 ` .
1215
You can’t perform that action at this time.
0 commit comments