Use actions/deploy-pages to deploy mdbook output#3419
Merged
Mark-Simulacrum merged 1 commit intorust-lang:masterfrom Apr 29, 2023
Merged
Use actions/deploy-pages to deploy mdbook output#3419Mark-Simulacrum merged 1 commit intorust-lang:masterfrom
actions/deploy-pages to deploy mdbook output#3419Mark-Simulacrum merged 1 commit intorust-lang:masterfrom
Conversation
Member
Author
|
Disclaimer: Due to the branch restrictions I could not test this, but as I mentioned above, we have been using a similar setup for the crates.io ops guide without any problems. |
Member
Author
|
@rust-lang/infra any thoughts on this? |
This was referenced Jun 20, 2023
pull Bot
pushed a commit
to johnperez416/cargo
that referenced
this pull request
Apr 20, 2026
…loyment (rust-lang#16876) 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GitHub has official support for deploying to GitHub Pages from a GitHub Actions workflow, without having to deal with special git branches.
This is accomplished by using https://github.com/actions/upload-pages-artifact and https://github.com/actions/deploy-pages. The first action is creating a build artifact from the generated
/bookfolder, while the second one is deploying that artifact to the GitHub Pages environment.For this to work, the "Pages" settings of the repository will have to be changed:
We are already using a similar setup for the crates.io ops guide, and it has been working without any issues for us. As a future second step we could even enable the
buildjob to run for PRs too, and only restrict thedeployjob to themasterbranch./cc @rust-lang/infra