Skip to content

Commit 4f77b50

Browse files
committed
feat: Add tag formatter for image #5
1 parent 6372d2e commit 4f77b50

2 files changed

Lines changed: 35 additions & 5 deletions

File tree

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
name: on-push-to-main.yaml
23

34
on:
@@ -6,5 +7,24 @@ on:
67
- main
78

89
jobs:
10+
format:
11+
uses: ./.github/workflows/reusable__format.yaml
12+
with:
13+
COMMIT_HASH: ${{ github.sha }}
14+
15+
tests:
16+
uses: ./.github/workflows/reusable__tests.yaml
17+
with:
18+
COMMIT_HASH: ${{ github.sha }}
19+
20+
e2e-tests:
21+
needs:
22+
- format
23+
- tests
24+
uses: ./.github/workflows/reusable__e2e-testing.yaml
25+
with:
26+
COMMIT_HASH: ${{ github.sha }}
27+
928
push-to-ghcr:
10-
uses: .github/workflows/reusable__upload-to-ghcr.yaml
29+
needs: [e2e-tests, format, tests]
30+
uses: .github/workflows/reusable__upload-to-ghcr.yaml

.github/workflows/reusable__upload-to-ghcr.yaml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
name: reusable__upload-to-ghcr.yaml
2+
name: Upload to image ot ghcr
33

44
on:
55
workflow_call:
@@ -26,13 +26,23 @@ jobs:
2626
uses: docker/login-action@v3
2727
with:
2828
registry: ${{ env.REGISTRY }}
29-
username: ${{ github.actor }}
29+
username: ${{ github.repository_owner }}
3030
password: ${{ secrets.GITHUB_TOKEN }}
3131

32+
- name: Extract Docker metadata
33+
id: meta
34+
uses: docker/metadata-action@v5
35+
with:
36+
images: ${{ env.REGISTRY }}/${{ github.repository }}
37+
tags: |
38+
type=sha,format=long,prefix=
39+
type=raw,value=latest
40+
3241
- name: Build and push Docker image
3342
id: push
3443
uses: docker/build-push-action@v5
3544
with:
36-
context: .
45+
context: ./Docker
46+
file: ./Dockerfile
3747
push: true
38-
tags: ${{ env.COMMIT_HASH }}:latest
48+
tags: ${{ steps.meta.outputs.tags }}

0 commit comments

Comments
 (0)