Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
Signed-off-by: Yuri Shkuro <[email protected]>
  • Loading branch information
yurishkuro committed Jun 29, 2024
1 parent a825762 commit e3d0207
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions .github/workflows/build-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,31 @@ jobs:

- name: Start local Docker registry
if: ${{ github.event_name == 'pull_request' }}
run: docker inspect registry > /dev/null || docker run --rm -d -p 5000:5000 --name registry registry:2
shell: /bin/bash
run: |
docker inspect registry > /dev/null || docker run --rm -d -p 5000:5000 --name registry registry:2
check_ready() {
url="http://localhost:5000/v2/"
end_time=$((SECONDS + 60))
while [[ $SECONDS -lt $end_time ]]; do
response=$(curl -s -I -o /dev/null -w "%{http_code}" $url)
if [[ $response -ge 200 && $response -lt 300 ]]; then
echo "Registry endpoint available at $url"
return 0
fi
echo "Registry endpoint not available yet"
sleep 10
done
echo "Registry endpoint unavailable"
return 1
}
check_ready
- name: Extract tags/labels from Git
id: docker_meta
uses: docker/metadata-action@v5
uses: docker/metadata-action@v6
with:
# when running on pull request we want to push the image to local registry for further testing
images: |
Expand Down

0 comments on commit e3d0207

Please sign in to comment.