-
-
Save flybayer/8908acdf61e3adbf1f571efe6a8e31b0 to your computer and use it in GitHub Desktop.
Using dotenv to load vars when dploying to now. But still keep it out of your repo.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// load as early as possible | |
if(process.env.NOW){ | |
require('dotenv').config({path:'./.envnow', silent:true}); | |
}else{ | |
require('dotenv').config({silent:true}); | |
} | |
// now you can deploy with: | |
//$cp .env .envnow && now && rm -r .envnow | |
//this will copy current .env to .envnow, then deploy to now, then delete the .envnow file | |
//so it stays out of your repo. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment