Skip to content

Commit df46f7d

Browse files
committed
Add support for building and pushing Docker image with tags
1 parent 397d38a commit df46f7d

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

.github/workflows/docker-image.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ name: Docker Image CI
33
on:
44
push:
55
branches: [ "main" ]
6-
pull_request:
7-
branches: [ "main" ]
6+
tags:
7+
- '*'
88

99
jobs:
1010
build:
@@ -25,4 +25,13 @@ jobs:
2525
with:
2626
context: .
2727
push: true
28-
tags: ghcr.io/${{ github.repository }}/minio-backup:latest
28+
tags: ghcr.io/${{ github.repository }}/${{ github.event.repository.name }}:latest
29+
30+
- name: Build and push Docker image with the tag name
31+
if: startsWith(github.ref, 'refs/tags/')
32+
uses: docker/build-push-action@v5
33+
with:
34+
context: .
35+
push: true
36+
tags: |
37+
ghcr.io/${{ github.repository }}:${{ github.event.repository.name }}:${{ github.ref_name }}

0 commit comments

Comments
 (0)