From 1fd0ec4041199443f91554c217b4c400bca60867 Mon Sep 17 00:00:00 2001 From: Andy Zhao <17884966+Zhao-Andy@users.noreply.github.com> Date: Fri, 26 Feb 2021 10:30:56 -0500 Subject: [PATCH] Try yarn instead over npm for storybook deploys (#12376) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Try yarn instead over npm * Remove ignore flag and use default flag * Add yarn version * Remove --docs * Use NPM :( we don't have a yarn.lock in app/javascript * Use NPM :( we don't have a yarn.lock in app/javascript * Updated base to root to use yarn * hack the command with cd 🙃 * debuggng * copy package.json and yarn.lock from root * Set flag to use yarn explicitly * Oops * Try a different way * Package.json not yarn.lock * Maybe?? * Install yarn with npm then run yarn install?? * Add a Node version * Try one more thing... * Syntax error * I think it's working... * nvm it didn't work * Use any 14.14 node version -- syntax correct maybe? * Fix broken redirects smh * Update redirects for storybook * Remove unnecessary redirect rule * Trigger notifications * Trigger notifications * Remove some unused comments --- app/javascript/netlify.toml | 29 +++++++++++++++++++---------- docs/netlify.toml | 15 ++++----------- 2 files changed, 23 insertions(+), 21 deletions(-) diff --git a/app/javascript/netlify.toml b/app/javascript/netlify.toml index 7d54d7718..8b044dd4b 100644 --- a/app/javascript/netlify.toml +++ b/app/javascript/netlify.toml @@ -1,12 +1,21 @@ -# Global settings applied to the whole site. -# -# “publish” is the directory to publish (relative to root of your repo), -# “command” is your build command, -# “base” is directory to change to before starting build. if you set base: -# that is where we will look for package.json/.nvmrc/etc not repo root! - [build] - # base set in Netlify settings UI - command = "npm install && npm run build-storybook" + # environment variables NODE_VERSION and YARN_VERSION set in Netlify settings UI + base = "app/javascript" + command = "npm install yarn && yarn install && yarn run build-storybook" publish = "storybook-static" - ignore = "git diff --quiet HEAD^ HEAD app/javascript && git diff --quiet HEAD^ HEAD app/assets/stylesheets/config" + ignore = "git diff --quiet HEAD^ HEAD ./ && git diff --quiet HEAD^ HEAD ../assets/stylesheets/config/" +[build.environment] + NODE_VERSION = "14.14" + +# See for more options +[[redirects]] +from = "http://storybook.dev.to" +to = "https://storybook.forem.com" +status = 301 +force = true + +[[redirects]] +from = "http://storybook.dev.to/*" +to = "https://storybook.forem.com/:splat" +status = 301 +force = true diff --git a/docs/netlify.toml b/docs/netlify.toml index ebce68e99..99506d84b 100644 --- a/docs/netlify.toml +++ b/docs/netlify.toml @@ -1,10 +1,3 @@ -# Global settings applied to the whole site. -# -# “publish” is the directory to publish (relative to root of your repo), -# “command” is your build command, -# “base” is directory to change to before starting build. if you set base: -# that is where we will look for package.json/.nvmrc/etc not repo root! - [build] command = "make" [environment] @@ -12,13 +5,13 @@ # See for more options [[redirects]] -from = "http://docs.dev.to" -to = "http://docs.forem.com" +from = "https://docs.dev.to" +to = "https://docs.forem.com" status = 301 force = true [[redirects]] -from = "http://docs.dev.to/*" -to = "http://docs.forem.com/:splat" +from = "https://docs.dev.to/*" +to = "https://docs.forem.com/:splat" status = 301 force = true