File tree Expand file tree Collapse file tree 1 file changed +25
-2
lines changed
Expand file tree Collapse file tree 1 file changed +25
-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+ rm -f ./api.html
18+ cat > " api.html" << EOL
19+ <!DOCTYPE html>
20+ <html>
21+ <head>
22+ <title>Redirecting...</title>
23+ <meta charset="utf-8">
24+ <link rel="canonical" href="${PACKAGE_VERSION} /api/index.html" />
25+ <meta http-equiv="refresh" content="0; url=${PACKAGE_VERSION} /api/index.html" />
26+ </head>
27+ <body>
28+ <p>Redirecting you to the <a href="${PACKAGE_VERSION} /api/index.html">latest API Docs</a>...</p>
29+ </body>
30+ </html>
31+
32+ EOL
33+
34+ echo " Pushing the changes..."
1435git add --all
1536git commit -m " Add $PACKAGE_VERSION Api docs" --author=" Build Agent<dbx-csharp-dotnet@mongodb.com>"
1637git push --repo=" $DOCS_REPO "
38+
39+ echo " Done."
You can’t perform that action at this time.
0 commit comments