File tree Expand file tree Collapse file tree 1 file changed +19
-2
lines changed
Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -87,13 +87,30 @@ jobs:
8787 env :
8888 RUSTDOCFLAGS : -D rustdoc::broken_intra_doc_links -D missing-docs
8989 run : |
90+ # Build documentation
9091 cargo doc --no-deps --all-features
91- printf '<meta http-equiv="refresh" content="0;url=%s/index.html">' $(cargo tree | head -1 | cut -d' ' -f1) > target/doc/index.html
92+
93+ # Auto-detect documentation directory
94+ # Check if doc exists in target/doc or target/*/doc
95+ if [ -d "target/doc" ]; then
96+ DOC_DIR="target/doc"
97+ else
98+ # Find doc directory under target/*/doc pattern
99+ DOC_DIR=$(find target -type d -name doc -path "target/*/doc" | head -n 1)
100+ if [ -z "$DOC_DIR" ]; then
101+ echo "Error: Could not find documentation directory"
102+ exit 1
103+ fi
104+ fi
105+
106+ echo "Documentation found in: $DOC_DIR"
107+ printf '<meta http-equiv="refresh" content="0;url=%s/index.html">' $(cargo tree | head -1 | cut -d' ' -f1) > "${DOC_DIR}/index.html"
108+ echo "DOC_DIR=${DOC_DIR}" >> $GITHUB_ENV
92109
93110 - name : Upload artifact
94111 uses : actions/upload-pages-artifact@v3
95112 with :
96- path : target/doc
113+ path : ${{ env.DOC_DIR }}
97114
98115 deploy :
99116 name : Deploy to GitHub Pages
You can’t perform that action at this time.
0 commit comments