Skip to content

chore(ci): Use actions/deploy-pages for Cargo Contributor Guide deployment#16876

Merged
ehuss merged 2 commits intorust-lang:masterfrom
Turbo87:deploy-pages
Apr 20, 2026
Merged

chore(ci): Use actions/deploy-pages for Cargo Contributor Guide deployment#16876
ehuss merged 2 commits intorust-lang:masterfrom
Turbo87:deploy-pages

Conversation

@Turbo87
Copy link
Copy Markdown
Member

@Turbo87 Turbo87 commented Apr 12, 2026

This replaces the gh-pages git branch deployment with the official actions/upload-pages-artifact and actions/deploy-pages actions.

It requires changing the repository's Pages settings from "Deploy from a branch" to "GitHub Actions" as described also in rust-lang/rfcs#3419, which has used a similar setup for a while now.

I've tested the build job in my forked repo and verified that the artifact contents match the current content of the gh-pages branch. I did not test the deploy job with my fork repo, but since it is the same as in e.g. the rfcs repo I don't expect any issues from that.

@rustbot rustbot added A-infrastructure Area: infrastructure around the cargo repo, ci, releases, etc. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 12, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 12, 2026

r? @weihanglo

rustbot has assigned @weihanglo.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: @ehuss, @epage, @weihanglo
  • @ehuss, @epage, @weihanglo expanded to ehuss, epage, weihanglo
  • Random selection from ehuss, epage, weihanglo

Comment thread .github/workflows/contrib.yml
@epage epage added this pull request to the merge queue Apr 20, 2026
@ehuss ehuss removed this pull request from the merge queue due to a manual request Apr 20, 2026
@ehuss
Copy link
Copy Markdown
Contributor

ehuss commented Apr 20, 2026

Sorry, I removed from queue because I saw this got rid of possibly changed the CNAME protection. It's very important that it be set up correctly, and I didn't see a discussion here about that. Is the CNAME protected?

@ehuss
Copy link
Copy Markdown
Contributor

ehuss commented Apr 20, 2026

Specifically, I'm uncertain about how the sequence of changes will affect things with the CNAME file. The GitHub docs are not terribly clear. I'm guessing what might happen with merging this is that:

  1. This will set up a job that will fail (or not publish correctly) because the settings are not configured for publishing via an Action.
  2. The gh-pages branch will survive, and GitHub still publishes from there (with the CNAME file).
  3. When we switch the settings, we'll need to manually make sure the domain is configured in the settings. My reading of the documentation is that a CNAME file is ignored when using the publish action (but it's not clear to me).

Does that all sound accurate? I'm not confident of any of those steps.

We previously verified the domain. Will changing the settings affect that verification?

@Turbo87
Copy link
Copy Markdown
Member Author

Turbo87 commented Apr 20, 2026

Sorry, I removed from queue because I saw this got rid of possibly changed the CNAME protection. It's very important that it be set up correctly, and I didn't see a discussion here about that. Is the CNAME protected?

the CNAME file is generated by /ci/generate.py and works the same as before. it is no longer added via git add because it is generated directly in the right place (src/doc/contrib/gh-pages) and the upload-pages-artifact step picks it up automatically.

@Turbo87
Copy link
Copy Markdown
Member Author

Turbo87 commented Apr 20, 2026

3. My reading of the documentation is that a CNAME file is ignored when using the publish action (but it's not clear to me).

admittedly, I wasn't aware of that and https://docs.github.com/en/pages/configuring-a-custom-domain-for-your-github-pages-site/managing-a-custom-domain-for-your-github-pages-site sounds like you are correct.

in that case the PR should probably drop the CNAME file in favor of setting the custom domain in the repo settings 🤔

@ehuss
Copy link
Copy Markdown
Contributor

ehuss commented Apr 20, 2026

I'll drop a note with infra to see if they can be available to make the settings change.

Here: https://rust-lang.zulipchat.com/#narrow/channel/242791-t-infra/topic/Changing.20cargo.27s.20GitHub.20Pages.20deploy/with/588459618

Turbo87 added 2 commits April 20, 2026 20:49
…loyment

Replace git worktree-based deployment with the official
`actions/upload-pages-artifact` and `actions/deploy-pages` actions.

This requires changing the repository's Pages settings from
"Deploy from a branch" to "GitHub Actions".
`CNAME` files are apparently ignored if GitHub Pages are deployed via GitHub Actions and instead the custom domain needs to be set in the repository settings.
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 20, 2026

This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@Turbo87
Copy link
Copy Markdown
Member Author

Turbo87 commented Apr 20, 2026

I've rebased and added a second commit which drops the CNAME functionality.

@ehuss
Copy link
Copy Markdown
Contributor

ehuss commented Apr 20, 2026

Also, I double-checked that there is already a gh-pages Environment in the team database. The deploy action creates one automatically if it doesn't exist, which can be awkward. AFAIK, that shouldn't be a problem.

@ehuss
Copy link
Copy Markdown
Contributor

ehuss commented Apr 20, 2026

Checked with infra, and seems we should be good.

@ehuss ehuss added this pull request to the merge queue Apr 20, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Apr 20, 2026
@ehuss ehuss added this pull request to the merge queue Apr 20, 2026
Merged via the queue into rust-lang:master with commit 862f60b Apr 20, 2026
29 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 20, 2026
@Turbo87
Copy link
Copy Markdown
Member Author

Turbo87 commented Apr 21, 2026

awesome, thanks for pushing this over the finish line @ehuss :)

rust-bors Bot pushed a commit to rust-lang/rust that referenced this pull request Apr 21, 2026
Update cargo submodule

9 commits in 7ecf0285ebb408d596e4a8ac76a0980d8edb7005..06ac0e7c05770a8c7bbf67bdd12fa1a1eefdc8ae
2026-04-18 15:34:11 +0000 to 2026-04-21 15:33:56 +0000
- test(git): add regression test for full-hash GitHub fast path (rust-lang/cargo#16919)
- fix(help): add `.1` extension to man page temp file (rust-lang/cargo#16917)
- Fix flaky test: sparse_blocking_count (rust-lang/cargo#16916)
- Fix flaky test compile_offline_while_transitive_dep_not_cached (rust-lang/cargo#16915)
- Fix test fetch_all_platform_dependencies_when_no_target_is_given (rust-lang/cargo#16914)
- chore(ci): Use `actions/deploy-pages` for Cargo Contributor Guide deployment (rust-lang/cargo#16876)
- Convert GitHub fast path to use http_async (rust-lang/cargo#16912)
- refactor(network): convert .crate downloads to use http_async (rust-lang/cargo#16902)
- fix(tests): flaky test local_poll_adapter deferred_success (rust-lang/cargo#16909)

r? ghost
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-infrastructure Area: infrastructure around the cargo repo, ci, releases, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants