Skip to content

Commit d782bd5

Browse files
committed
add tag
1 parent 7cfffa9 commit d782bd5

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

.github/workflows/build_PR.yml

+10
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,15 @@ jobs:
145145
- name: Prepare
146146
id: prep
147147
run: |
148+
VERSION=edge
149+
if [[ $GITHUB_REF == refs/tags/* ]]; then
150+
VERSION=${GITHUB_REF#refs/tags/}
151+
elif [[ $GITHUB_REF == refs/heads/* ]]; then
152+
VERSION=$(echo ${GITHUB_REF#refs/heads/} | sed -r 's#/+#-#g')
153+
elif [[ $GITHUB_REF == refs/pull/* ]]; then
154+
VERSION=pr-${{ github.event.number }}
155+
fi
156+
echo ::set-output name=version::${VERSION}
148157
echo ::set-output name=created::$(date -u +'%Y-%m-%dT%H:%M:%SZ')
149158
- name: build image and push to GitHub Container Registry
150159
uses: docker/build-push-action@v2
@@ -153,6 +162,7 @@ jobs:
153162
context: images
154163
tags: |
155164
${{ env.registry }}/${{ github.repository_owner }}/${{ env.image }}:latest
165+
${{ env.registry }}/${{ github.repository_owner }}/${{ env.image }}:${{ steps.prep.outputs.version }}
156166
${{ env.registry }}/${{ github.repository_owner }}/${{ env.image }}:${{needs.Prepare.outputs.BRANCH}}-latest
157167
${{ env.registry }}/${{ github.repository_owner }}/${{ env.image }}:${{needs.Prepare.outputs.TAG_NAME}}
158168
labels: |

0 commit comments

Comments
 (0)