Skip to content

Update release workflow to use branch tagging info correctly. #7

Update release workflow to use branch tagging info correctly.

Update release workflow to use branch tagging info correctly. #7

Workflow file for this run

name: Tag Image with Release Version
on:
push:
tags:
- v*
jobs:
push-release-images:
runs-on: ubuntu-22.04
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
DOCKER_PREFIX: ${{ secrets.DOCKER_PREFIX }}
BUILDONLY: true
steps:
- uses: actions/checkout@v2
- name: Prepare K3d cluster
run: |
cd ./test && bash ./prepare-platform.sh
sudo update-alternatives --set java /usr/lib/jvm/java-17-openjdk-amd64/bin/java
java --version
- name: Build Platform locally
run: |
export JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64
cd test && bash build-local-platform.sh
- 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
echo Selected tag ${TARGET_DOCKER_TAG}
# Tag and push passed "k3d-iff.localhost:12345" with release tag
images=$(docker images --format "{{.Repository}}:{{.Tag}}" | grep k3d-iff | grep ${DOCKER_TAG} )
echo I will push the following images: ${images}
for image in $images; do
newimage=$(echo $image | sed -r "s/:${DOCKER_TAG}/:${TARGET_DOCKER_TAG}/g" | sed -r "s/k3d-iff.localhost:12345\///g");
echo I will push image ${image} as ${newimage}
docker tag ${image} ${newimage};
docker push ${newimage};
done
- name: Setup upterm session
if: failure()
uses: lhotari/action-upterm@v1