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

Remove now.json in favor of built-in env vars support #1362

Closed
leerob opened this issue Mar 8, 2021 · 5 comments
Closed

Remove now.json in favor of built-in env vars support #1362

leerob opened this issue Mar 8, 2021 · 5 comments

Comments

@leerob
Copy link

leerob commented Mar 8, 2021

Hey 😄 You might already know this, but I figured I'd mention it. You can remove now.json entirely with environment variables support first-class through dotenv in Next.js. You can also remove env from next.config.js!

Also - Inside Vercel, you can now more easily choose if your env var is a secret or plaintext.

@brianlovin
Copy link
Owner

I just have to go through and manually add all of these to my Vercel dashboard though, yeah? Or does having the secrets set already make this work out of the box? Right now I see this in the dashboard:

Screen Shot 2021-03-08 at 10 09 07@2x

But of course I've already done vercel secrets add ... for each of the variables listed in the now.json file.

@leerob
Copy link
Author

leerob commented Mar 8, 2021

Convert - it's converting them from just secrets to env variables. When you select "secret", you'll be able to find all the existing secrets in the dropdown.

The biggest benefit is being able to run vercel env pull .env.local or a new machine and automatically set up your env, plus aligns with the best practices for env variables for those forking the repo 😄

If you hit any issues, please let me know!

@brianlovin
Copy link
Owner

@leerob I just closed this after making the changes, but now I'm wondering: is there a best practice for using GitHub actions to run CI with whatever the vercel dev equivalent would be? I need Cypress to run with access to my environment variables, in a secure way of course.

@leerob
Copy link
Author

leerob commented Apr 27, 2021

👋 I would suggest running Cypress again the preview deployment URL. That's what we do at Vercel 😄

@brianlovin
Copy link
Owner

Oh wow, that's quite smart actually – any chance you are able to share or publish some of those action workflow files? Otherwise I can probably figure out how to string that together so things run in the correct order.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants