Skip to content

Commit 7030dbf

Browse files
authored
Merge pull request #2 from Dpbm/fix_workflows
Fix workflows
2 parents d259550 + 97c7023 commit 7030dbf

File tree

5 files changed

+23
-7
lines changed

5 files changed

+23
-7
lines changed

.github/workflows/dockerhub.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Publish Docker image
1+
name: Publish Docker image (DockerHub)
22

33
on:
44
push:
@@ -9,7 +9,7 @@ env:
99
IMAGE_NAME: ${{ github.event.repository.name }}
1010

1111
jobs:
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 }}

.github/workflows/ghrc.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Create and publish a Docker image
1+
name: Publish Docker image (GHRC)
22

33
on:
44
push:
@@ -7,9 +7,10 @@ on:
77
env:
88
REGISTRY: ghcr.io
99
IMAGE_NAME: ${{ github.repository }}
10+
USERNAME: ${{ github.actor }}
1011

1112
jobs:
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 }}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,3 +144,5 @@ dist
144144
# End of https://www.toptal.com/developers/gitignore/api/node
145145

146146
*.db
147+
148+
*.secrets

.vscode/settings.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"cSpell.words": [
3+
"DOCKERHUB",
4+
"ghrc",
5+
"github"
6+
]
7+
}

readme.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff 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

1114
Nesse repositório, você encontrará a minha versão do segundo desafio do `DSIN Coderchallenge 2023`.
1215

0 commit comments

Comments
 (0)