name: Generate Documentation
on:
workflow_run:
workflows: [Test]
types: [completed]
branches: [main]
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
generate:
name: Generate
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@nightly
- run: cargo +nightly doc --all-features
env:
RUSTDOCFLAGS: "--cfg docsrs"
- run: |
echo '
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<meta http-equiv="refresh" content="0; url=smallish/">
<script type="text/javascript">
window.location.href = "smallish/"
</script>
<title>Page Redirection</title>
</head>
<body>
If you are not redirected automatically, follow this <a href="smallish/">this link</a>.
</body>
</html>' > target/doc/index.html
- uses: actions/upload-pages-artifact@v5
with:
path: target/doc/
deploy:
name: Deploy
runs-on: ubuntu-latest
needs: generate
if: ${{ github.event.workflow_run.conclusion == 'success' }}
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/configure-pages@v6
- uses: actions/deploy-pages@v5
id: deployment