Skip to content

Commit 4424819

Browse files
authored
ci: Publish crate docs on Github Pages (#953)
* ci: Publish crate docs on Github Pages * temp(ci): Trigger workflow on PR for testing * Revert "temp(ci): Trigger workflow on PR for testing" This reverts commit 734b6c4.
1 parent 3542f97 commit 4424819

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

.github/workflows/publish-docs.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
---
2+
name: Publish Crate Docs
3+
4+
# Once the `preview` input is available, this can also run on PR when docs are
5+
# changed.
6+
7+
on:
8+
push:
9+
branches:
10+
- main
11+
paths:
12+
- .github/workflows/publish-docs.yml
13+
- crates/**
14+
15+
env:
16+
RUST_TOOLCHAIN_VERSION: "1.82.0"
17+
18+
jobs:
19+
build-docs:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: Checkout Repository
23+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
24+
25+
- uses: dtolnay/rust-toolchain@master
26+
with:
27+
toolchain: ${{ env.RUST_TOOLCHAIN_VERSION }}
28+
29+
- name: Build Crate Docs
30+
run: cargo doc --no-deps --all-features
31+
32+
- name: Add Redirect
33+
run: echo '<meta http-equiv="refresh" content="0;url=stackable_operator/index.html">' > target/doc/index.html
34+
35+
- name: Upload Documentation Artifacts
36+
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa #v3.0.1
37+
with:
38+
path: target/doc
39+
40+
publish-docs:
41+
runs-on: ubuntu-latest
42+
needs: build-docs
43+
permissions:
44+
pages: write
45+
id-token: write
46+
environment:
47+
name: github-pages
48+
url: ${{ steps.deploy.outputs.page_url }}
49+
steps:
50+
- name: Deploy to Github Pages
51+
id: deploy
52+
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5

0 commit comments

Comments
 (0)