Skip to content

Commit

Permalink
Merge pull request #2072 from jaimergp/netlify-previews
Browse files Browse the repository at this point in the history
Enable PR previews on netlify
  • Loading branch information
beckermr authored Feb 8, 2024
2 parents 69ef595 + 60d95d2 commit 6eaf385
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
7 changes: 6 additions & 1 deletion docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ const editUrl = {
editUrl: "https://github.com/conda-forge/conda-forge.github.io/tree/main/",
};

var copyright = `Copyright © ${new Date().getFullYear()} conda-forge · Built with Docusaurus`;
if (process.env.NETLIFY) {
copyright += ` · Deployed on <a href="https://www.netlify.com/" target="_blank">Netlify</a>`;
}

/** @type {import('@docusaurus/types').Config} */
const config = {
title: "conda-forge | community-driven packaging for conda",
Expand Down Expand Up @@ -360,7 +365,7 @@ const config = {
],
},
],
copyright: `Copyright © ${new Date().getFullYear()} conda-forge · Built with Docusaurus`,
copyright: copyright,
},
prism: {
theme: lightCodeTheme,
Expand Down
20 changes: 20 additions & 0 deletions netlify.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[build]
# Directory (relative to root of your repo) that contains the deploy-ready
# HTML files and assets generated by the build. If a base directory has
# been specified, include it in the publish directory path.
publish = "build"

# Default build command.
command = """
curl -L -o miniforge.sh https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh &&
bash miniforge.sh -bfp ~/miniforge &&
rm -rf miniforge.sh &&
source ~/miniforge/etc/profile.d/conda.sh &&
conda env create -f .ci_scripts/environment.yml &&
conda activate conda-forge-docs &&
./.ci_scripts/update_docs
"""

# We only want to build PR previews.
# Exit code == 0 means that the build is ignored.
ignore = 'test "$PULL_REQUEST" == "false"'

0 comments on commit 6eaf385

Please sign in to comment.