Skip to content

Commit f98ee92

Browse files
authored
Merge pull request #168 from snyk/fix/wait-for-new-gh-release
fix: wait for GH pages to update on release
2 parents 631aae3 + f0a5fa9 commit f98ee92

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

scripts/publish-gh-pages.sh

+15
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,19 @@ git add ./README.md
4040
COMMIT_MESSAGE='fix: :egg: Automatic Publish '${NEW_TAG}' :egg:'
4141
git commit -m "${COMMIT_MESSAGE}"
4242
git push --quiet --set-upstream origin-pages gh-pages
43+
44+
# Wait up to 10 minutes for the new GH pages
45+
echo waiting for the new release to appear in github
46+
attempts=60
47+
sleep_time=10
48+
for (( i=0; i<${attempts}; i++ )); do
49+
count=$(curl -s https://snyk.github.io/kubernetes-monitor/snyk-monitor/values.yaml | grep --line-buffered -c "tag: ${NEW_TAG}")
50+
if [[ "$count" == "1" ]]; then
51+
attempts=${i}
52+
break
53+
fi
54+
sleep $sleep_time
55+
done
56+
echo it took github $(( $attempts * $sleep_time )) seconds to update the github pages
57+
4358
./scripts/slack-notify-push.sh "gh-pages"

0 commit comments

Comments
 (0)