Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On push sync the docs to gh-pages #1086

Merged
merged 2 commits into from
Feb 6, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 27 additions & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,9 @@ jobs:
RUSTFLAGS: ${{env.RUSTFLAGS}}
RUSTDOCFLAGS: ${{env.RUSTDOCFLAGS}}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Don't do a shallow clone since we need to push gh-pages

- name: Set up cargo cache
uses: Swatinem/rust-cache@v2
Expand Down Expand Up @@ -149,6 +151,30 @@ jobs:
command: test
args: --all-targets --all-features

- name: Set up git author
if: ${{ github.event_name == 'push' }}
run: |
remote_repo="https://${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
git config --global user.name "${GITHUB_ACTOR}"
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Set up ghp-import
if: ${{ github.event_name == 'push' }}
run: pip install ghp-import

- name: Patch in a redirect page
if: ${{ github.event_name == 'push' }}
run: echo "<meta http-equiv=\"refresh\" content=\"0; url=${REDIRECT_CRATE}\">" > target/doc/index.html
env:
REDIRECT_CRATE: rerun_sdk

# See: https://github.com/c-w/ghp-import
- name: Deploy the docs
if: ${{ github.event_name == 'push' }}
run: python3 -m ghp_import -n -p -x rust/head target/doc/ -m "Update the rust docs"

# ---------------------------------------------------------------------------

rs-check-wasm:
Expand Down