Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable PR previews on netlify #2072

Merged
merged 4 commits into from
Feb 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"'