Skip to content

Commit

Permalink
fix the docker build version scheme (#33)
Browse files Browse the repository at this point in the history
* fix the docker build version scheme
  • Loading branch information
MichaelsJP authored May 5, 2021
1 parent 64ea9c8 commit dba5c6e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/build-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ jobs:
TAGS_VERSION="--tag ${DOCKER_IMAGE}:${DOCKER_VERSION}"
TAGS_LATEST="--tag ${DOCKER_IMAGE}:latest"
TAGS_NIGHTLY="--tag ${DOCKER_IMAGE}:nightly"
if [[ $CURRENT_VERSIONS =~ $DOCKER_VERSION ]]; then
echo "Version: $DOCKER_VERSION present or latest. Skipping it!"
Expand All @@ -73,15 +74,19 @@ jobs:
--build-arg OHSOMEAPI_VERSION=${DOCKER_VERSION} \
${TAGS_VERSION} .
echo ::set-output name=buildx_args_latest::--platform ${DOCKER_PLATFORMS} \
--build-arg OHSOMEAPI_VERSION=latest \
--build-arg OHSOMEAPI_VERSION=${DOCKER_VERSION} \
${TAGS_LATEST} .
echo ::set-output name=buildx_args_nightly::--platform ${DOCKER_PLATFORMS} \
--build-arg OHSOMEAPI_VERSION=nightly \
${TAGS_NIGHTLY} .
- name: Build version if not present
if: ${{ steps.prepare.outputs.build_version == 'true' }}
run: |
docker buildx build --output "type=image,push=false" ${{ steps.prepare.outputs.buildx_args_version }}
docker buildx build --output "type=image,push=false" ${{ steps.prepare.outputs.buildx_args_latest }}
- name: Build latest
run: |
docker buildx build --output "type=image,push=false" ${{ steps.prepare.outputs.buildx_args_latest }}
docker buildx build --output "type=image,push=false" ${{ steps.prepare.outputs.buildx_args_nightly }}
- name: Login to DockerHub
if: success()
uses: docker/login-action@v1
Expand All @@ -92,6 +97,7 @@ jobs:
if: ${{ steps.prepare.outputs.build_version == 'true' }}
run: |
docker buildx build --output "type=image,push=true" ${{ steps.prepare.outputs.buildx_args_version }}
- name: Publish latest
run: |
docker buildx build --output "type=image,push=true" ${{ steps.prepare.outputs.buildx_args_latest }}
- name: Publish nightly
run: |
docker buildx build --output "type=image,push=true" ${{ steps.prepare.outputs.buildx_args_nightly }}
10 changes: 5 additions & 5 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ jobs:
DOCKER_IMAGE=dockertest/ohsome-api
DOCKER_PLATFORMS=linux/amd64
TAGS_LATEST="--tag ${DOCKER_IMAGE}:latest"
TAGS_NIGHTLY="--tag ${DOCKER_IMAGE}:nightly"
echo ::set-output name=buildx_args_latest::--platform ${DOCKER_PLATFORMS} \
echo ::set-output name=buildx_args_nightly::--platform ${DOCKER_PLATFORMS} \
--build-arg OHSOMEAPI_VERSION=latest \
${TAGS_LATEST} .
- name: Build latest
${TAGS_NIGHTLY} .
- name: Build nightly
run: |
docker buildx build --output "type=image,push=false" ${{ steps.prepare.outputs.buildx_args_latest }}
docker buildx build --output "type=image,push=false" ${{ steps.prepare.outputs.buildx_args_nightly }}

0 comments on commit dba5c6e

Please sign in to comment.