Commit d782bd5 1 parent 7cfffa9 commit d782bd5 Copy full SHA for d782bd5
File tree 1 file changed +10
-0
lines changed
1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -145,6 +145,15 @@ jobs:
145
145
- name : Prepare
146
146
id : prep
147
147
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}
148
157
echo ::set-output name=created::$(date -u +'%Y-%m-%dT%H:%M:%SZ')
149
158
- name : build image and push to GitHub Container Registry
150
159
uses : docker/build-push-action@v2
@@ -153,6 +162,7 @@ jobs:
153
162
context : images
154
163
tags : |
155
164
${{ env.registry }}/${{ github.repository_owner }}/${{ env.image }}:latest
165
+ ${{ env.registry }}/${{ github.repository_owner }}/${{ env.image }}:${{ steps.prep.outputs.version }}
156
166
${{ env.registry }}/${{ github.repository_owner }}/${{ env.image }}:${{needs.Prepare.outputs.BRANCH}}-latest
157
167
${{ env.registry }}/${{ github.repository_owner }}/${{ env.image }}:${{needs.Prepare.outputs.TAG_NAME}}
158
168
labels : |
You can’t perform that action at this time.
0 commit comments