also looking at this
fix(site): a missing page says 404, and the crawler files are checked on deploy
#60
4 files
+40
-5
| @@ -241,4 +241,17 @@ jobs: | ||
| 241 | 241 | *"not one Uplink issued"*) ;; |
| 242 | 242 | *) echo "::error::/api/license/check did not answer as the license API: ${said:0:200}"; exit 1 ;; |
| 243 | 243 | esac |
| 244 | echo "Home page, pricing, checkout, license API, 404s and assets check out." | |
| 244 | # A miss has to say 404 in the status line, not only in the body: a | |
| 245 | # crawler indexes a 200 whatever it reads, and a client treats it as | |
| 246 | # a hit. | |
| 247 | [ "$(status no-such-page-here)" = 404 ] || { echo "::error::A missing page answers $(status no-such-page-here), not 404."; exit 1; } | |
| 248 | # Checked against the live site rather than the repository, because a | |
| 249 | # CDN can serve its own managed robots.txt over this one and nothing | |
| 250 | # in the repository would know. | |
| 251 | [ "$(status sitemap.xml)" = 200 ] || { echo "::error::/sitemap.xml answers $(status sitemap.xml)."; exit 1; } | |
| 252 | robots=$(curl -s --max-time 20 "${url}robots.txt") | |
| 253 | case "$robots" in | |
| 254 | *"Sitemap: https://uplink.stacksjs.com/sitemap.xml"*) ;; | |
| 255 | *) echo "::error::/robots.txt is not the one in public/, so something is serving its own: ${robots:0:200}"; exit 1 ;; | |
| 256 | esac | |
| 257 | echo "Home page, pricing, checkout, license API, 404s, robots, sitemap and assets check out." | |