Skip to content
This repository was archived by the owner on Apr 25, 2025. It is now read-only.

Commit c4a06d6

Browse files
committed
Update CI
1 parent 51e01b9 commit c4a06d6

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

.github/workflows/build-image.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ on:
33
push:
44
branches:
55
- 'master'
6+
tags:
7+
- "v*"
68

79
jobs:
810
build_image:
@@ -18,6 +20,15 @@ jobs:
1820
username: ${{ github.repository_owner }}
1921
password: ${{ secrets.GITHUB_TOKEN }}
2022

23+
- id: create_tagname
24+
run: |
25+
TAG_NAME=${GITHUB_REF##*/}
26+
if [[ $TAG_NAME == "master" ]]; then
27+
echo "TAG_NAME=latest" >> "$GITHUB_OUTPUT"
28+
elif [[ ${TAG_NAME:0:1} == "v" ]]; then
29+
echo "TAG_NAME=${VERSION_NAME:1}" >> "$GITHUB_OUTPUT"
30+
fi
31+
2132
- name: Build and Push
2233
uses: docker/[email protected]
2334
with:
@@ -30,4 +41,4 @@ jobs:
3041
cache-from: type=gha
3142
cache-to: type=gha,mode=max
3243
tags: |
33-
ghcr.io/yanorei32/http-request-duplicator:latest
44+
ghcr.io/yanorei32/http-request-duplicator:${{ steps.create_tagname.outputs.TAG_NAME }}

0 commit comments

Comments
 (0)