Skip to content

Commit

Permalink
Use DOCKER_IMAGE env var for Docker image basename, fix set-output wa…
Browse files Browse the repository at this point in the history
…rning
  • Loading branch information
andygruber committed Nov 23, 2023
1 parent 3585bb9 commit e15af66
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions .github/workflows/generate-winccoa-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
else
ENV_NAME=staging
fi
echo "::set-output name=env_name::${ENV_NAME}"
echo "env_name=${ENV_NAME}" >> $GITHUB_OUTPUT
- name: Chosen environment
run: echo "Environment used ${{ steps.branch_check.outputs.env_name }}"
Expand Down Expand Up @@ -57,20 +57,20 @@ jobs:
[[ $zip_file =~ ([0-9]+)\.([0-9]+)_linux_debian_x86_64_P([0-9]+)\.?([0-9]*)\.zip ]]
major_version=${BASH_REMATCH[1]}
minor_version=${BASH_REMATCH[2]}
patch_version=${BASH_REMATCH[3]}
revision=${BASH_REMATCH[4]}
patch_version=$(echo ${BASH_REMATCH[3]} | sed 's/^0*//') # Remove leading zeros
revision=${BASH_REMATCH[4]#\.} # Remove leading dot from the revision
if [ "$revision" != "0" ] && [ ! -z "$revision" ]; then
version_string="$major_version.$minor_version.$patch_version.$revision"
else
version_string="$major_version.$minor_version.$patch_version"
fi
echo "::set-output name=major_version::${major_version}"
echo "::set-output name=minor_version::${minor_version}"
echo "::set-output name=patch_version::${patch_version}"
echo "::set-output name=revision::${revision}"
echo "::set-output name=version::${version_string}"
echo "major_version=${major_version}" >> $GITHUB_OUTPUT
echo "minor_version=${minor_version}" >> $GITHUB_OUTPUT
echo "patch_version=${patch_version}" >> $GITHUB_OUTPUT
echo "revision=${revision}" >> $GITHUB_OUTPUT
echo "version=${version_string}" >> $GITHUB_OUTPUT
else
echo "No ZIP file found"
Expand Down Expand Up @@ -111,13 +111,16 @@ jobs:
- name: Docker build and push images
working-directory: ./build-docker
run: |
for target in api server; do
# specify targets from Dockerfile_install here
for target in api server uiserver; do
tag_suffix=${target}
image_name="agruberetm/winccoa:v${{ steps.get_version.outputs.version }}-${tag_suffix}"
image_name="${DOCKER_IMAGE}:v${{ steps.get_version.outputs.version }}-${tag_suffix}"
DOCKER_BUILDKIT=0 docker build --network=winccoarepo --build-arg BASE_IMAGE=winccoaprepare:temp --target winccoa${target} --tag ${image_name} -f Dockerfile_install .
docker push ${image_name}
done
env:
DOCKER_IMAGE: ${{ secrets.DOCKER_IMAGE }}

- name: Docker build teardown
working-directory: ./build-docker
Expand Down

0 comments on commit e15af66

Please sign in to comment.