Skip to content

Commit

Permalink
updates CI
Browse files Browse the repository at this point in the history
  • Loading branch information
saxix committed May 28, 2024
1 parent b2da4af commit 86bb8cd
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .github/actions/hash/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ runs:
# args:
# - ${{ inputs.files }}
steps:
- run: |
- name: Calculate release hash
shell: bash --noprofile --norc -eo pipefail -ux {0}
run: |
LOCK_SHA=$(echo sha1sum ${{ inputs.files }} | sha1sum | awk '{print $1}' | cut -c 1-8)
echo "hash=$LOCK_SHA" >> "$GITHUB_OUTPUT"
40 changes: 40 additions & 0 deletions .github/actions/image_exists/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# ref: https://docs.github.com/en/actions/creating-actions/creating-a-docker-container-action
name: 'Che cif image exists in dockerhub'
description: 'Calculate deps and os hash'
inputs:
image:
description: 'Docker Image '
required: true
username:
required: true
password:
required: true

outputs:
exists:
description: 'The time we greeted you'
type: bool

runs:
using: 'composite'
# args:
# - ${{ inputs.files }}
steps:
- name: DockerHub login
uses: docker/login-action@v3
with:
username: ${{ inputs.username }}
password: ${{ inputs.password }}
- name: Check Image Exists
continue-on-error: true
shell: bash --noprofile --norc -eo pipefail -ux {0}
run: |
set +e
exists=$(docker manifest inspect ${{inputs.image}} > /dev/null 2>&1 && echo "exists" || echo "not_found")
if [ $exists = "exists" ];then
echo "exists=true" >> "$GITHUB_OUTPUT"
echo "Image ${{inputs.image}} found"
else
echo "exists=false" >> "$GITHUB_OUTPUT"
echo "Image ${{inputs.image}} does not exist"
fi

0 comments on commit 86bb8cd

Please sign in to comment.