Skip to content

Commit

Permalink
feat: adds image to outputs on build-unstable
Browse files Browse the repository at this point in the history
  • Loading branch information
niquerio committed May 2, 2023
1 parent cffaf19 commit 037199d
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions .github/workflows/build-unstable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,16 @@ on:
sha:
description: "github commit hash that corressponds to the tag"
value: ${{ jobs.build_unstable.outputs.sha }}
image:
description: "full image address"
value: ${{ jobs.build_unstable.outputs.image }}

jobs:
build_unstable:
runs-on: ubuntu-latest
outputs:
sha: ${{ steps.tag_check.outputs.tag }}
image: ${{ steps.image_check.outputs.image }}
steps:
- uses: actions/checkout@v3
with:
Expand Down Expand Up @@ -60,9 +64,12 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}
- name: Check that the tag exists in container registry
id: image_check
env:
IMAGE: ghcr.io/mlibrary/${{ inputs.image_name }}-unstable:${{ steps.tag_check.outputs.tag }}
run: |
if docker manifest inspect ghcr.io/mlibrary/${{ inputs.image_name }}-unstable:${{ steps.tag_check.outputs.tag }} > /dev/null; then
echo 'image_exists=true' >> $GITHUB_OUTPUT
echo "image=$IMAGE" >> $GITHUB_OUTPUT
if docker manifest inspect $IMAGE > /dev/null; then
echo "image_exists=true" >> $GITHUB_OUTPUT
echo "image exists!"
else
echo "image doesn't exist; Starting to Build and push image"
Expand All @@ -83,6 +90,4 @@ jobs:
push: true
tags: |
ghcr.io/mlibrary/${{ inputs.image_name }}-unstable:latest
ghcr.io/mlibrary/${{ inputs.image_name }}-unstable:${{ steps.tag_check.outputs.tag }}
${{ steps.image_check.outputs.image }}

0 comments on commit 037199d

Please sign in to comment.