Skip to content

Commit ad647f6

Browse files
liam-laiLiam Lai
authored andcommitted
add tag build in ci (#70)
* add tag build in ci * add tag build in ci --------- Co-authored-by: Liam Lai <liam.lai@datameshgroup.com.au> (cherry picked from commit 8f47dd0)
1 parent c84197b commit ad647f6

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

.github/workflows/ci.yml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ on:
44
push:
55
branches:
66
- master
7+
tags:
8+
- '*'
9+
710
workflow_dispatch: #allow manual trigger to workflow
811

912
jobs:
@@ -46,8 +49,17 @@ jobs:
4649
DOCKER_PASSWORD: ${{secrets.DOCKER_ACCESS_TOKEN}}
4750
run: |
4851
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
52+
53+
- name: Determine Docker Image Name
54+
id: image
55+
run: |
56+
if [[ "${{github.ref_name}}" == "master" ]]; then
57+
echo "name= xinfinorg/xdcsubnets:latest" >> $GITHUB_OUTPUT
58+
else
59+
echo "name= xinfinorg/xdcsubnets:${{github.ref_name}}" >> $GITHUB_OUTPUT
60+
fi
61+
4962
- name: Build and push image
5063
run: |
51-
docker build -t xdc-subnet -f docker/Dockerfile .
52-
docker tag xdc-subnet:latest xinfinorg/xdcsubnets:latest
53-
docker push xinfinorg/xdcsubnets:latest
64+
docker build . --file Dockerfile --tag ${{ steps.image.outputs.name }}
65+
docker push ${{ steps.image.outputs.name }}

0 commit comments

Comments
 (0)