Skip to content

Commit 497d848

Browse files
committed
Add CI to build dev docs
1 parent 0e48990 commit 497d848

File tree

1 file changed

+68
-0
lines changed

1 file changed

+68
-0
lines changed

.github/workflows/docs.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Documentation (dev)
2+
3+
on:
4+
push:
5+
branches: [dev]
6+
workflow_dispatch:
7+
8+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
9+
permissions:
10+
contents: read
11+
pages: write
12+
id-token: write
13+
14+
# Allow only one concurrent deployment
15+
concurrency:
16+
group: pages
17+
cancel-in-progress: true
18+
19+
jobs:
20+
build:
21+
name: Build Documentation
22+
runs-on: ubuntu-latest
23+
steps:
24+
- uses: actions/checkout@main
25+
- uses: dtolnay/rust-toolchain@nightly
26+
- uses: Swatinem/rust-cache@v2
27+
28+
- name: Build documentation
29+
env:
30+
RUSTDOCFLAGS: "--cfg docsrs"
31+
run: |
32+
cargo +nightly doc --no-deps \
33+
--features "lua55,vendored,async,send,serde,macros,anyhow,userdata-wrappers"
34+
35+
- name: Create index redirect
36+
run: |
37+
echo '<!DOCTYPE html>
38+
<html>
39+
<head>
40+
<meta charset="utf-8">
41+
<title>Redirecting to mlua documentation</title>
42+
<meta http-equiv="refresh" content="0; URL=mlua/index.html">
43+
<link rel="canonical" href="mlua/index.html">
44+
</head>
45+
<body>
46+
<p>Redirecting to <a href="mlua/index.html">mlua documentation</a>...</p>
47+
</body>
48+
</html>' > target/doc/index.html
49+
50+
- name: Setup Pages
51+
uses: actions/configure-pages@v5
52+
53+
- name: Upload artifact
54+
uses: actions/upload-pages-artifact@v4
55+
with:
56+
path: target/doc
57+
58+
deploy:
59+
name: Deploy to GitHub Pages
60+
environment:
61+
name: github-pages
62+
url: ${{ steps.deployment.outputs.page_url }}
63+
runs-on: ubuntu-latest
64+
needs: build
65+
steps:
66+
- name: Deploy to GitHub Pages
67+
id: deployment
68+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)