Skip to content

Deploy godoc pages via Pages artifact instead of gh-pages branch - #4699

Closed
jack-edmonds-dd wants to merge 1 commit into
masterfrom
jack.edmonds/docs-pages-artifact
Closed

jack-edmonds-dd wants to merge 1 commit into
masterfrom
jack.edmonds/docs-pages-artifact

Conversation

@jack-edmonds-dd

Copy link
Copy Markdown
Contributor

What does this PR do?

Changes the docs workflow to deploy godoc pages with actions/upload-pages-artifact + actions/deploy-pages. Previously peaceiris/actions-gh-pages pushed dist/ to the gh-pages branch.

gopages renders the whole api/datadogV2 package into a single index.html. On the current gh-pages branch that file is 104,684,323 bytes, which is ~170 KB under git's 100 MiB per-file push limit. DataDog/datadog-api-spec#6828 (stable Experiments v2 APIs) brings it to ~110 MB, so the existing -size +100M guard fails on #4668.

The 100 MiB limit only applies to git pushes. To check that Pages serves larger files when deployed as an artifact, I set up a throwaway repo and deployed a 110,426,709-byte HTML file with these actions. It was served with HTTP 200, full content-length, and a matching SHA-256. The documented Pages limits are 1 GB for the whole site and a 10-minute deploy timeout.

Changes:

  • Split into a build job, which runs on PRs and pushes, and a deploy job, which runs only on push to master.
  • Removed the -size +100M guard.
  • Dropped contents: write. The workflow now needs contents: read plus pages: write/id-token: write, and only the deploy job gets those.

Additional Notes

Repo admin action required before merging. Otherwise the first deploy from master will fail. The current site stays up until then.

  1. Settings → Pages → Build and deployment → Source: change from "Deploy from a branch" (gh-pages) to GitHub Actions.
  2. Settings → Environments → github-pages: the deployment branch policy currently allows only gh-pages. Add master.

After the first successful deploy, the gh-pages branch is no longer used and can be deleted.

Review checklist

  • This PR includes all newly recorded cassettes for any modified tests.

  • This PR does not rely on API client schema changes.

    • The CI should be fully passing.
  • Or, this PR relies on API schema changes and this is a Draft PR to include tests for that new functionality.

    • Note: CI shouldn't be run on this Draft PR, as its expected to fail without the corresponding schema changes.

🤖 Generated with Claude Code

The datadogV2 package renders to a single index.html that is now within
~170 KB of git's 100 MiB per-file limit, and DataDog/datadog-api-spec#6828
pushes it over. Deploying with actions/upload-pages-artifact and
actions/deploy-pages avoids git entirely, so the 100 MiB guard is no longer
needed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jack-edmonds-dd jack-edmonds-dd added the changelog/no-changelog Changes don't appear in changelog label Oct 1, 2026
@jack-edmonds-dd
jack-edmonds-dd requested review from a team as code owners October 1, 2026 21:21
@jack-edmonds-dd

Copy link
Copy Markdown
Contributor Author

Duplicate of #4694

@jack-edmonds-dd jack-edmonds-dd marked this as a duplicate of #4694 Oct 2, 2026
@jack-edmonds-dd
jack-edmonds-dd deleted the jack.edmonds/docs-pages-artifact branch October 2, 2026 01:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/no-changelog Changes don't appear in changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant