Skip to content

Commit 6eaf385

Browse files
authored
Merge pull request #2072 from jaimergp/netlify-previews
Enable PR previews on netlify
2 parents 69ef595 + 60d95d2 commit 6eaf385

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

docusaurus.config.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ const editUrl = {
88
editUrl: "https://github.com/conda-forge/conda-forge.github.io/tree/main/",
99
};
1010

11+
var copyright = `Copyright © ${new Date().getFullYear()} conda-forge · Built with Docusaurus`;
12+
if (process.env.NETLIFY) {
13+
copyright += ` · Deployed on <a href="https://www.netlify.com/" target="_blank">Netlify</a>`;
14+
}
15+
1116
/** @type {import('@docusaurus/types').Config} */
1217
const config = {
1318
title: "conda-forge | community-driven packaging for conda",
@@ -360,7 +365,7 @@ const config = {
360365
],
361366
},
362367
],
363-
copyright: `Copyright © ${new Date().getFullYear()} conda-forge · Built with Docusaurus`,
368+
copyright: copyright,
364369
},
365370
prism: {
366371
theme: lightCodeTheme,

netlify.toml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
[build]
2+
# Directory (relative to root of your repo) that contains the deploy-ready
3+
# HTML files and assets generated by the build. If a base directory has
4+
# been specified, include it in the publish directory path.
5+
publish = "build"
6+
7+
# Default build command.
8+
command = """
9+
curl -L -o miniforge.sh https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh &&
10+
bash miniforge.sh -bfp ~/miniforge &&
11+
rm -rf miniforge.sh &&
12+
source ~/miniforge/etc/profile.d/conda.sh &&
13+
conda env create -f .ci_scripts/environment.yml &&
14+
conda activate conda-forge-docs &&
15+
./.ci_scripts/update_docs
16+
"""
17+
18+
# We only want to build PR previews.
19+
# Exit code == 0 means that the build is ignored.
20+
ignore = 'test "$PULL_REQUEST" == "false"'

0 commit comments

Comments
 (0)