Skip to content

Commit

Permalink
rename output
Browse files Browse the repository at this point in the history
Signed-off-by: Andreas Heinrich <andreas.heinrich@rwth-aachen.de>
  • Loading branch information
andistorm committed Jul 9, 2024
1 parent b31d9d1 commit 8957314
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 22 deletions.
8 changes: 3 additions & 5 deletions .github/workflows/deploy-docker-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ env:
DOCKER_DIRECTORY: docker/images
PLATFORMS: |
linux/amd64
# linux/arm64
# linux/arm/v7
PATH_TO_DEPLOY_SINGLE_DOCKER_IMAGE_WORKFLOW: .github/workflows/deploy-single-docker-image.yml
PATH_TO_DEPLOY_DOCKER_IMAGES_WORKFLOW: .github/workflows/deploy-docker-images.yml

Expand Down Expand Up @@ -109,7 +107,7 @@ jobs:
${{ needs.env-setup.outputs.path_to_deploy_single_docker_image_workflow }}
${{ needs.env-setup.outputs.path_to_deploy_docker_images_workflow }}
build_args: |
BASE_IMAGE_TAG=${{ needs.run-env-base.outputs.one_image_tag }}
BASE_IMAGE_TAG=${{ needs.run-env-base.outputs.one_image_tag_short }}
dev-env-base:
needs:
Expand All @@ -132,7 +130,7 @@ jobs:
${{ needs.env-setup.outputs.path_to_deploy_single_docker_image_workflow }}
${{ needs.env-setup.outputs.path_to_deploy_docker_images_workflow }}
build_args: |
BASE_IMAGE_TAG=${{ needs.build-env-base.outputs.one_image_tag }}
BASE_IMAGE_TAG=${{ needs.build-env-base.outputs.one_image_tag_short }}
build-kit-base:
needs:
- env-setup
Expand All @@ -154,7 +152,7 @@ jobs:
${{ needs.env-setup.outputs.path_to_deploy_single_docker_image_workflow }}
${{ needs.env-setup.outputs.path_to_deploy_docker_images_workflow }}
build_args: |
BASE_IMAGE_TAG=${{ needs.build-env-base.outputs.one_image_tag }}
BASE_IMAGE_TAG=${{ needs.build-env-base.outputs.one_image_tag_short }}
# Include deprecated images for backwards compatibility
deprecated-everest-clang-format:
if: ${{ needs.env-setup.outputs.build_deprecated_images == 'true' }}
Expand Down
42 changes: 26 additions & 16 deletions .github/workflows/deploy-single-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,12 @@ on:
image_tags:
description: 'Tags of the deployed image with image name'
value: ${{ jobs.build-and-push.outputs.image_tags }}
one_image_tag:
one_image_tag_short:
description: 'One tag of the deployed image without image name'
value: ${{ jobs.build-and-push.outputs.one_image_tag }}
value: ${{ jobs.build-and-push.outputs.one_image_tag_short }}
one_image_tag_long:
description: 'One tag of the deployed image with image name'
value: ${{ jobs.build-and-push.outputs.one_image_tag_long }}
secrets:
SA_GITHUB_PAT:
description: 'Github PAT with access to the repository'
Expand Down Expand Up @@ -158,7 +161,8 @@ jobs:
runs-on: ubuntu-22.04
outputs:
image_tags: ${{ steps.meta.outputs.tags }}
one_image_tag: ${{ steps.extract-one-tag.outputs.tag }}
one_image_tag_short: ${{ steps.extract-one-tag.outputs.tag_short }}
one_image_tag_long: ${{ steps.extract-one-tag.outputs.tag_long }}
steps:
- name: Checkout Dockerfile
uses: actions/checkout@v3
Expand Down Expand Up @@ -225,25 +229,31 @@ jobs:
run: |
import os
tags = "${{ steps.meta.outputs.tags }}".split(",")
tags = [tag.split(":")[-1] for tag in tags]
if len(tags) == 0:
tags_short = [tag.split(":")[-1] for tag in tags]
if len(tags_short) == 0:
print("No tags found!❌")
exit(1)
tag = None
for t in tags:
tag_short = None
for t in tags_short:
if t.startswith("v"):
tag = t
tag_short = t
break
if tag is None:
for t in tags:
if tag_short is None:
for t in tags_short:
if not t.startswith("latest"):
tag = t
tag_short = t
break
if tag is None:
tag = tags[0]
if tag is None:
if tag_short is None:
tag_short = tags_short[0]
if tag_short is None:
print("No tag found!❌")
exit(1)
for t in tags:
if t.endswith(tag_short):
tag_long = t
break
with open(os.environ["GITHUB_OUTPUT"], "a") as f:
f.write(f"tag={tag}\n")
print(f"Set tag={tag}")
f.write(f"tag_short={tag}\n")
print(f"Set tag_short={tag}")
f.write(f"tag_long={tag_long}\n")
print(f"Set tag_long={tag_long}")
1 change: 0 additions & 1 deletion docker/images/build-kit-base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
ARG BASE_IMAGE_TAG=latest
FROM ghcr.io/everest/everest-ci/build-env-base:${BASE_IMAGE_TAG}


ENV WORKSPACE_PATH=/workspace
ENV ASSETS_PATH=/assets
ARG EXT_MOUNT=/ext
Expand Down

0 comments on commit 8957314

Please sign in to comment.