From e11e452329a077c04c067c66bbe55ff056cb0b9a Mon Sep 17 00:00:00 2001 From: jaimergp Date: Wed, 7 Feb 2024 16:44:46 +0100 Subject: [PATCH 1/4] enable previews on netlify --- docusaurus.config.js | 7 ++++++- netlify.toml | 20 ++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 netlify.toml diff --git a/docusaurus.config.js b/docusaurus.config.js index 2133a7d356..39ab54bb7c 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -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 Netlify`; +} + /** @type {import('@docusaurus/types').Config} */ const config = { title: "conda-forge | community-driven packaging for conda", @@ -360,7 +365,7 @@ const config = { ], }, ], - copyright: `Copyright © ${new Date().getFullYear()} conda-forge · Built with Docusaurus`, + copyright: copyright, }, prism: { theme: lightCodeTheme, diff --git a/netlify.toml b/netlify.toml new file mode 100644 index 0000000000..03a0c0d15a --- /dev/null +++ b/netlify.toml @@ -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 = "site" + + # 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/update_docs && + 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"' From 8a7ded84040d55e82f7cf2d0f0273053f7020df8 Mon Sep 17 00:00:00 2001 From: jaimergp Date: Wed, 7 Feb 2024 16:58:58 +0100 Subject: [PATCH 2/4] retrigger From 56830b2b4bd493e3ebd90d61de2de950933cf0c7 Mon Sep 17 00:00:00 2001 From: jaimergp Date: Wed, 7 Feb 2024 16:59:13 +0100 Subject: [PATCH 3/4] Fix environment.yml path --- netlify.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netlify.toml b/netlify.toml index 03a0c0d15a..41c9f12f5b 100644 --- a/netlify.toml +++ b/netlify.toml @@ -10,7 +10,7 @@ bash miniforge.sh -bfp ~/miniforge && rm -rf miniforge.sh && source ~/miniforge/etc/profile.d/conda.sh && - conda env create -f .ci_scripts/update_docs && + conda env create -f .ci_scripts/environment.yml && conda activate conda-forge-docs && ./.ci_scripts/update_docs """ From 60d95d271e6ca9a8a6495e1b1433e4780658bd4b Mon Sep 17 00:00:00 2001 From: jaimergp Date: Wed, 7 Feb 2024 17:03:49 +0100 Subject: [PATCH 4/4] Deploy from build/ --- netlify.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netlify.toml b/netlify.toml index 41c9f12f5b..078ab5e6e0 100644 --- a/netlify.toml +++ b/netlify.toml @@ -2,7 +2,7 @@ # 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 = "site" + publish = "build" # Default build command. command = """