-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Tag&Push images according to release tag closes #358 Signed-off-by: Oguzcan Kirmemis <[email protected]>
- Loading branch information
1 parent
a1ed822
commit dbaadb4
Showing
1 changed file
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: Tag Image with Release Version | ||
|
||
on: | ||
push: | ||
tags: | ||
- v* | ||
|
||
jobs: | ||
call-build: | ||
uses: IndustryFusion/DigitalTwin/.github/workflows/build.yaml@main | ||
call-test: | ||
uses: IndustryFusion/DigitalTwin/.github/workflows/k8s-tests.yaml@main | ||
push-release-images: | ||
needs: call-test | ||
runs-on: private | ||
env: | ||
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} | ||
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | ||
DOCKER_PREFIX: ${{ secrets.DOCKER_PREFIX }} | ||
SELF_HOSTED_RUNNER: true | ||
steps: | ||
- name: Push release images | ||
shell: bash | ||
run: | | ||
set +o pipefail | ||
docker login -u "${DOCKER_USERNAME}" -p "${DOCKER_PASSWORD}" | ||
TARGET_DOCKER_TAG=`git describe --tags --exact-match` || exit 1 | ||
# Tag and push passed "k3d-iff.localhost:12345" with release tag | ||
images=$(docker images --format "{{.Repository}}:{{.Tag}}" | grep ":0.1") | ||
for image in $images; do | ||
newimage=$(echo $image | sed -r "s/:0.1/:${TARGET_DOCKER_TAG}/g" | sed -r "s/k3d-iff.localhost:12345/${DOCKER_PREFIX}/g"); | ||
docker tag ${image} ${newimage}; | ||
docker push ${newimage}; | ||
done | ||
# Tag and push scorpio-aio image | ||
image=$(docker images --format "{{.Repository}}:{{.Tag}}" | grep "k3d-iff.localhost:12345/digitaltwin/scorpio-all-in-one") | ||
newimage="${DOCKER_PREFIX}/digitaltwin:${TARGET_DOCKER_TAG}" | ||
docker tag ${image} ${newimage} | ||
docker push ${newimage} | ||