Is it possible to put environment variables in deploy.toml?

Hey I saw some related questions (Use Environment variable in *.toml?) and (Deploy using github actions - #2 by bitshift) but they seemed pretty specialized for github actions. My question is a bit simpler. My redwood project is checked into github and it seems like deploy.toml requires the privateKeyPath to be set as a constant string. It also doesn’t seem to accept paths starting with ~ (which would be an ok workaround). This path is different for everyone else working on the project so ideally that would be set via environment variable. I couldn’t figure out how to load environment variables in deploy.toml though. Alternatively I could add deploy.toml to .gitignore but there is some config in there that I would like to be shared for everyone deploying. Does anyone know a good path forward here?

afaik, TOML itself does not support this. I briefly looked at the Redwood code using deploy.toml, and I don’t think there is an easy way to pass in an overwritten value using environment variables through something like the CLI; (which would have been my suggestion if it was possible).

@rob, any suggestions?

Thanks for the reply. Was digging around and found feat(rw-toml): Support env var interpolation in redwood.toml (#3708) · redwoodjs/redwood@d767964 · GitHub. Maybe we could do something similar for deploy.toml? Let me write up a quick PR.

Took a stab in feat: Support env var interpolation in baremetal deploy.toml by jaiakt · Pull Request #7962 · redwoodjs/redwood · GitHub

1 Like