File tree Expand file tree Collapse file tree 1 file changed +26
-2
lines changed
Expand file tree Collapse file tree 1 file changed +26
-2
lines changed Original file line number Diff line number Diff line change 1- #! /usr/bin/env bash
1+ #! /usr/bin/env bash
22set -o errexit # Exit the script with error if any of the commands fail
33
44DOCS_REPO=" https://${GITHUB_USER} :${GITHUB_APIKEY} @github.com/mongodb/mongo-csharp-driver.git"
55
6- echo " Prepare github docs "
6+ echo " Cloning github repo... "
77git clone " $DOCS_REPO " ./gh-pages/ --branch gh-pages --single-branch
88
9+ echo " Adding the generated API-docs site..."
910mkdir ./gh-pages/" $PACKAGE_VERSION " /
1011cp -r ./artifacts/apidocs/" $PACKAGE_VERSION " /. ./gh-pages/" $PACKAGE_VERSION " /
1112
1213cd ./gh-pages
1314
15+ echo " Generating redirection page..."
16+ # setup simple redirection to the latest version.
17+
18+ rm -f ./latest.html
19+ cat > " latest.html" << EOL
20+ <!DOCTYPE html>
21+ <html>
22+ <head>
23+ <title>Redirecting...</title>
24+ <meta charset="utf-8">
25+ <link rel="canonical" href="https://mongodb.github.io/mongo-csharp-driver/${PACKAGE_VERSION} /api/index.html" />
26+ <meta http-equiv="refresh" content="0; url=https://mongodb.github.io/mongo-csharp-driver/${PACKAGE_VERSION} /api/index.html" />
27+ </head>
28+ <body>
29+ <p>Redirecting you to the <a href="https://mongodb.github.io/mongo-csharp-driver/${PACKAGE_VERSION} /api/index.html">latest API Docs</a>...</p>
30+ </body>
31+ </html>
32+
33+ EOL
34+
35+ echo " Pushing the changes..."
1436git add --all
1537git commit -m
" Add $PACKAGE_VERSION Api docs" --author=
" Build Agent<[email protected] >" 1638git push --repo=" $DOCS_REPO "
39+
40+ echo " Done."
You can’t perform that action at this time.
0 commit comments