Skip to content

Commit 22fbdc8

Browse files
authored
add job for publishing crate docs to GH pages
resolves #311
1 parent 4c93577 commit 22fbdc8

File tree

2 files changed

+86
-0
lines changed

2 files changed

+86
-0
lines changed
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>Redirecting...</title>
7+
<meta http-equiv="refresh" content="0; URL='./mdq'"/>
8+
<style>
9+
body {
10+
font-family: Arial, sans-serif;
11+
margin: 0;
12+
padding: 20px;
13+
display: flex;
14+
justify-content: center;
15+
align-items: center;
16+
height: 100vh;
17+
background-color: #f5f5f5;
18+
}
19+
20+
.redirect-message {
21+
text-align: center;
22+
padding: 20px;
23+
background-color: white;
24+
border-radius: 8px;
25+
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
26+
}
27+
28+
h1 {
29+
color: #333;
30+
}
31+
32+
p {
33+
color: #666;
34+
}
35+
36+
a {
37+
color: #0066cc;
38+
text-decoration: none;
39+
}
40+
</style>
41+
</head>
42+
<body>
43+
<div class="redirect-message">
44+
<h1>Redirecting...</h1>
45+
<p>You are being redirected to <a href="./mdq">./mdq</a>.</p>
46+
<p>If you are not redirected automatically, please click the link above.</p>
47+
</div>
48+
</body>
49+
</html>

.github/workflows/readme-checks.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,40 @@ jobs:
4545
exit "$exit_code"
4646
env:
4747
MSRV_VERSION: ${{ steps.run-msrv.outputs.result }}
48+
49+
build-crate-docs:
50+
runs-on: ubuntu-latest
51+
steps:
52+
53+
- name: Checkout
54+
uses: actions/checkout@v4
55+
56+
- name: Build docs
57+
run: cargo doc --no-deps
58+
59+
- name: Add redirect page
60+
run: cp .github/gha_assets/crate-doc-root-redirect.html target/doc/index.html
61+
62+
- name: Upload artifact
63+
uses: actions/upload-pages-artifact@v3
64+
with:
65+
path: target/doc
66+
67+
deploy-crate-docs:
68+
needs: build-crate-docs
69+
runs-on: ubuntu-latest
70+
environment:
71+
name: github-pages
72+
url: ${{ steps.deployment.outputs.page_url }}
73+
concurrency:
74+
group: "pages"
75+
cancel-in-progress: false
76+
permissions:
77+
contents: read
78+
pages: write
79+
id-token: write
80+
steps:
81+
82+
- name: Deploy to GitHub Pages
83+
id: deployment
84+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)