Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Netlify Free Password Protection
{
...,
"scripts": {
"start": "gatsby develop -p 1234 -H 0.0.0.0",
"publish": "npm run _clean && npm run _build && npm run _encrypt && npm run _envDeploy",
"//": "========= PRIVATE SCRIPTS =========",
"_clean": "gatsby clean",
"_build": "gatsby build",
"_encrypt": "npx staticrypt public/index.html P@55W0RD -o public/index.html",
"_deploy": "npx netlify-cli deploy --dir=public --prod",
"_envDeploy": "NETLIFY_SITE_ID=abc-defg-hijk-lmnop NETLIFY_AUTH_TOKEN=abcdefg0123456789 bash -c 'npm run _deploy'"
},
...,
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.