resolve all internal ambiguities (#10411) #89
This file contains 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
name: Deploy Docs | |
on: | |
push: | |
branches: | |
- 'main' | |
# Allows running the action manually. | |
workflow_dispatch: | |
env: | |
CARGO_TERM_COLOR: always | |
RUSTDOCFLAGS: --html-in-header header.html | |
# Sets the permissions to allow deploying to Github pages. | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
# Only allow one deployment to run at a time, however it will not cancel in-progress runs. | |
concurrency: | |
group: "pages" | |
cancel-in-progress: false | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Rust | |
uses: dtolnay/rust-toolchain@stable | |
- name: Install alsa and udev | |
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev libwayland-dev libxkbcommon-dev | |
# This does the following: | |
# - Replaces the docs icon with one that clearly denotes it's not the released package on crates.io | |
# - Adds a meta tag that forces Google not to index any page on the site. | |
- name: Pre-docs-build | |
run: | | |
sed -i.bak "s/icon.png/icon-docs-dev.png/" src/lib.rs | |
echo "<meta name=\"robots\" content=\"noindex\">" > header.html | |
- name: Build docs | |
run: cargo doc --all-features --no-deps -p bevy | |
# This adds the following: | |
# - A top level redirect to the bevy crate documentation | |
# - A CNAME file for redirecting the docs domain to the API reference | |
# - A robots.txt file to forbid any crawling of the site (to defer to the docs.rs site on search engines). | |
- name: Finalize documentation | |
run: | | |
echo "<meta http-equiv=\"refresh\" content=\"0; url=bevy/index.html\">" > target/doc/index.html | |
echo "dev-docs.bevyengine.org" > target/doc/CNAME | |
echo "User-Agent: *\nDisallow: /" > target/doc/robots.txt | |
- name: Upload site artifact | |
uses: actions/upload-pages-artifact@v1 | |
with: | |
path: target/doc | |
- name: Deploy to Github Pages | |
id: deployment | |
uses: actions/deploy-pages@v2 |