diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 1eb81a2..aa71595 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -105,3 +105,18 @@ jobs: - name: Publish the exact Pages artifact id: deployment uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4 + - name: Verify anonymous live pages match the deployed artifact + env: + SITE_URL: ${{ steps.deployment.outputs.page_url }} + run: | + test "$SITE_URL" = 'https://valgorithms.github.io/YoutubePHP/' + for page in index.html classes/YouTube-YouTube.html guides/index.html guides/github-actions-uploader.html guides/civ13-uploader-example.html guides/publishing.html graphs/classes.svg; do + relative="$page" + if [ "$page" = index.html ]; then relative=''; fi + status="$(curl -q --proto '=https' --tlsv1.2 --fail --silent --show-error \ + --connect-timeout 10 --max-time 20 --retry 3 --retry-delay 5 --retry-max-time 60 \ + --output "$RUNNER_TEMP/docs-readback" --write-out '%{http_code}' "$SITE_URL$relative")" + test "$status" = 200 + cmp "site/$page" "$RUNNER_TEMP/docs-readback" + printf 'Verified anonymous HTTP 200 and exact artifact bytes: %s\n' "$page" + done diff --git a/docs/publishing.md b/docs/publishing.md index 12dad9d..566987b 100644 --- a/docs/publishing.md +++ b/docs/publishing.md @@ -52,6 +52,12 @@ API reference, uploader guide and case study. Source generation alone is not a live deployment. The default address is `https://valgorithms.github.io/YoutubePHP/`. +The publisher checks seven live pages/resources with anonymous HTTPS requests, +requires HTTP 200 and compares each response byte-for-byte with the deployed +artifact. Requests have bounded timeouts/retries and no authentication or cookies. +This also provides readback when an operator's local network cannot reach the +Pages hostname. A successful upload to Pages alone does not pass that check. + References: [phpDocumentor configuration](https://docs.phpdoc.org/guide/references/configuration.html), [custom Pages workflows](https://docs.github.com/en/pages/getting-started-with-github-pages/using-custom-workflows-with-github-pages), [Pages publishing source](https://docs.github.com/en/pages/getting-started-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site).