Skip to content

Commit b873a81

Browse files
authored
Merge pull request #28 from TraGicCode/GH-27-publish-image-to-docker-hub
(GH-27) Publish image to docker hub
2 parents 2b8c09d + 8814782 commit b873a81

1 file changed

Lines changed: 30 additions & 3 deletions

File tree

.github/workflows/docker_build.yml

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build Docker Image
1+
name: Build and Publish Docker Image
22

33
on:
44
workflow_call:
@@ -18,5 +18,32 @@ jobs:
1818
- name: Set up Docker Buildx
1919
uses: docker/setup-buildx-action@v3
2020

21-
- name: Build Docker image
22-
run: docker build -f ./src/BuslyCLI.Console/Dockerfile -t busly-cli .
21+
22+
- name: Log in to Docker Hub
23+
uses: docker/login-action@v3
24+
with:
25+
username: tragiccode
26+
password: ${{ secrets.DOCKERHUB_TOKEN }}
27+
28+
- name: Extract metadata (tags, labels) for Docker
29+
id: meta
30+
uses: docker/metadata-action@v5
31+
with:
32+
images: tragiccode/busly-cli
33+
34+
- name: Build and push Docker image
35+
id: push
36+
uses: docker/build-push-action@v6
37+
with:
38+
context: .
39+
file: ./src/BuslyCLI.Console/Dockerfile
40+
push: true
41+
tags: ${{ steps.meta.outputs.tags }}
42+
labels: ${{ steps.meta.outputs.labels }}
43+
44+
- name: Generate artifact attestation
45+
uses: actions/attest-build-provenance@v3
46+
with:
47+
subject-name: index.docker.io/tragiccode/busly-cli
48+
subject-digest: ${{ steps.push.outputs.digest }}
49+
push-to-registry: true

0 commit comments

Comments
 (0)