Skip to content

Commit c8dbcd3

Browse files
authored
Publish latest rustdocs to gh-pages (awslabs#234)
1 parent e193e70 commit c8dbcd3

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

.github/workflows/build.yml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,24 @@ jobs:
6767
components: rustfmt
6868
override: true
6969
- name: Run fmt check
70-
run: cargo fmt --all -- --check
70+
run: cargo fmt --all -- --check
71+
72+
# publish rustdoc to a gh-pages branch on pushes to master
73+
# this can be helpful to those depending on the mainline branch
74+
publish-docs:
75+
if: github.ref == 'refs/heads/master'
76+
runs-on: ubuntu-latest
77+
needs: [build]
78+
steps:
79+
- name: Set up Rust
80+
uses: hecrj/setup-rust-action@v1
81+
- uses: actions/checkout@v2
82+
- name: Generate Docs
83+
run: |
84+
cargo doc --no-deps
85+
echo "<meta http-equiv=refresh content=0;url=`lambda/index.html>" > target/doc/index.html
86+
- name: Publish
87+
uses: peaceiris/actions-gh-pages@v3
88+
with:
89+
github_token: ${{ secrets.GITHUB_TOKEN }}
90+
publish_dir: ./target/doc

0 commit comments

Comments
 (0)