Skip to content

Commit b19c135

Browse files
authored
Enabling PR previews through Netlify deployments (SeleniumHQ#498)
1 parent 885bb83 commit b19c135

File tree

3 files changed

+31
-3
lines changed

3 files changed

+31
-3
lines changed

build-site.sh

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,22 @@
11
#!/bin/bash
22

3+
if [[ -z "${DEPLOY_PRIME_URL}" ]]; then
4+
USE_BASE_URL_SITE=""
5+
USE_BASE_URL_SITE_DOCS=""
6+
else
7+
echo -e "\033[0;32mNetlify DEPLOY_PRIME_URL detected, this seems to be a PR, deployment happening at ${DEPLOY_PRIME_URL}...\033[0m"
8+
USE_BASE_URL_SITE="-b ${DEPLOY_PRIME_URL}"
9+
USE_BASE_URL_DOCS="-b ${DEPLOY_PRIME_URL}/documentation"
10+
fi
11+
312
echo -e "\033[0;32mDeleting Hugo previously generated directories for docs and main site...\033[0m"
413
rm -rf site_source_files/public && rm -rf docs_source_files/public
514

615
echo -e "\033[0;32mGenerating Hugo site for docs...\033[0m"
7-
cd docs_source_files && hugo && cd ..
16+
cd docs_source_files && hugo --minify ${URL_BASE_DOCS} && cd ..
817

918
echo -e "\033[0;32mGenerating Hugo site for main website...\033[0m"
10-
cd site_source_files && hugo && cd ..
19+
cd site_source_files && hugo --minify ${URL_BASE_SITE} && cd ..
1120

1221
echo -e "\033[0;32mMerging both sites into a single one...\033[0m"
1322
mv docs_source_files/public/* site_source_files/public/documentation

netlify.toml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
[build]
2+
publish = "site_source_files/public"
3+
command = "chmod +x build-site.sh && ./build-site.sh"
4+
5+
[context.production.environment]
6+
HUGO_VERSION = "0.66.0"
7+
HUGO_ENV = "production"
8+
9+
[context.deploy-preview]
10+
command = "chmod +x build-site.sh && ./build-site.sh"
11+
12+
[context.deploy-preview.environment]
13+
HUGO_VERSION = "0.66.0"
14+
15+
[context.branch-deploy]
16+
command = "chmod +x build-site.sh && ./build-site.sh"
17+
18+
[context.branch-deploy.environment]
19+
HUGO_VERSION = "0.66.0"

site_source_files/content/downloads/C#.md renamed to site_source_files/content/downloads/c_sharp.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ DownloadLink = "https://goo.gl/uJJ5Sc"
1010
AlphaDownloadLink = "https://www.nuget.org/api/v2/package/Selenium.WebDriver/4.0.0-alpha05"
1111
ChangelogLink = "https://raw.githubusercontent.com/SeleniumHQ/selenium/trunk/dotnet/CHANGELOG"
1212
DocsLink = "https://goo.gl/uutZjZ"
13-
+++
13+
+++

0 commit comments

Comments
 (0)