diff --git a/.github/scripts/stage-pages-site.sh b/.github/scripts/stage-pages-site.sh index f9947f4..4521fe9 100755 --- a/.github/scripts/stage-pages-site.sh +++ b/.github/scripts/stage-pages-site.sh @@ -17,7 +17,7 @@ case "$channel" in prod) other=dev ;; dev) other=prod ;; *) echo "bad channel: $ rm -rf "$out" mkdir -p "$out/$channel" "$out/$other" -cp site/index.html site/_headers "$out/" +cp site/index.html site/404.html site/_headers "$out/" name="$(basename "$apk")" cp "$apk" "$out/$channel/$name" @@ -47,6 +47,11 @@ fi if [ "$code" = 404 ]; then echo "No $other channel published yet; skipping." rm -rf "$out/$other" +elif [ "$code" = 200 ] && ! jq -e .apkName "$out/$other/latest.json" >/dev/null 2>&1; then + # A 200 that is not our JSON: Pages without a 404.html answers unknown paths + # with index.html. Nothing is published on that channel. + echo "No $other channel published yet (200 but no latest.json); skipping." + rm -rf "$out/$other" elif [ "$code" = 200 ]; then other_name="$(jq -er .apkName "$out/$other/latest.json")" curl -fsS -o "$out/$other/$other_name" "$base/$other/$other_name" diff --git a/site/404.html b/site/404.html new file mode 100644 index 0000000..356ca3b --- /dev/null +++ b/site/404.html @@ -0,0 +1,3 @@ + +Not found +

404

Not found. Pro Libertate Games downloads