Skip to content

Commit 0927ddc

Browse files
committed
Edit docker build CI
1 parent e6a461c commit 0927ddc

File tree

1 file changed

+34
-8
lines changed

1 file changed

+34
-8
lines changed

.github/workflows/docker-image.yml

Lines changed: 34 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,40 @@ on:
44
workflow_dispatch:
55

66
jobs:
7-
build:
7+
push-to-registry:
88
runs-on: ubuntu-latest
9-
9+
permissions:
10+
packages: write
11+
contents: read
12+
id-token: write
13+
attestations: write
1014
steps:
1115
- uses: actions/checkout@v4
12-
- name: get-npm-version
13-
id: package-version
14-
uses: martinbeentjes/[email protected]
15-
- run: echo ${{ steps.package-version.outputs.current-version}}
16-
- name: Build the Docker image
17-
run: docker build . --file Dockerfile --tag tuanngocptn/sentry-telegram-webhook:${{ steps.package-version.outputs.current-version}}
16+
- name: Log in to Docker Hub
17+
uses: docker/login-action@v3
18+
with:
19+
username: ${{ secrets.DOCKER_USERNAME }}
20+
password: ${{ secrets.DOCKER_PASSWORD }}
21+
22+
- name: Extract metadata (tags, labels) for Docker
23+
id: meta
24+
uses: docker/metadata-action@v5
25+
with:
26+
images: tuanngocptn/sentry-telegram-webhook
27+
28+
- name: Build and push Docker image
29+
id: push
30+
uses: docker/build-push-action@v5
31+
with:
32+
context: .
33+
file: ./Dockerfile
34+
push: true
35+
tags: ${{ steps.meta.outputs.tags }}
36+
labels: ${{ steps.meta.outputs.labels }}
37+
38+
# - name: Generate artifact attestation
39+
# uses: actions/attest-build-provenance@v1
40+
# with:
41+
# subject-name: tuanngocptn/sentry-telegram-webhook
42+
# subject-digest: ${{ steps.push.outputs.digest }}
43+
# push-to-registry: true

0 commit comments

Comments
 (0)