diff --git a/.github/workflows/deploy-timeweb.yml b/.github/workflows/deploy-timeweb.yml index 1a3ad24..554860d 100644 --- a/.github/workflows/deploy-timeweb.yml +++ b/.github/workflows/deploy-timeweb.yml @@ -36,15 +36,19 @@ jobs: login_file="public/core/login-signature-v1776.js" logo_file="public/caterium-mark-light.svg" + sw_file="public/service-worker.js" test -s "$login_file" test -s "$logo_file" + test -s "$sw_file" local_login="$(sha256sum "$login_file" | awk '{print $1}')" local_logo="$(sha256sum "$logo_file" | awk '{print $1}')" + local_sw="$(sha256sum "$sw_file" | awk '{print $1}')" echo "Expected login sha256: $local_login" echo "Expected logo sha256: $local_logo" + echo "Expected SW sha256: $local_sw" for attempt in $(seq 1 18); do stamp="${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}-${attempt}" @@ -55,15 +59,20 @@ jobs: -o /tmp/caterium-login.js && \ curl -fsSL --connect-timeout 10 --max-time 30 \ "${TIMEWEB_BASE_URL}/caterium-mark-light.svg?deploy_check=${stamp}" \ - -o /tmp/caterium-mark.svg; then + -o /tmp/caterium-mark.svg && \ + curl -fsSL --connect-timeout 10 --max-time 30 \ + "${TIMEWEB_BASE_URL}/service-worker.js?deploy_check=${stamp}" \ + -o /tmp/caterium-sw.js; then remote_login="$(sha256sum /tmp/caterium-login.js | awk '{print $1}')" remote_logo="$(sha256sum /tmp/caterium-mark.svg | awk '{print $1}')" + remote_sw="$(sha256sum /tmp/caterium-sw.js | awk '{print $1}')" echo "Remote login sha256: $remote_login" echo "Remote logo sha256: $remote_logo" + echo "Remote SW sha256: $remote_sw" - if [ "$remote_login" = "$local_login" ] && [ "$remote_logo" = "$local_logo" ]; then - echo "Timeweb production is current." + if [ "$remote_login" = "$local_login" ] && [ "$remote_logo" = "$local_logo" ] && [ "$remote_sw" = "$local_sw" ]; then + echo "Timeweb production is current, including refreshed PWA cache." exit 0 fi else @@ -73,5 +82,5 @@ jobs: sleep 30 done - echo "::error::Timeweb did not reach the tested Caterium login revision within 9 minutes." + echo "::error::Timeweb did not reach the tested Caterium revision within 9 minutes." exit 1