1

We are using Github Action to deploy our code. On push, the source code will be pushed and we were able to build the code and deploy successfully if the config file is also tracked by the repository. However, we are encountering a problem with a config file in .gitignore.

Our app has different versions, controlled by this config file, and also this file is different from testing to production. Therefore, this file is standalone and not tracked by the git repository. However, for Github actions to build the project correctly, this file is necessary and has to be placed on a certain path of the project, e.g., /configs/env_configs.json.

This seems like a very common use case but I find very little information in Github action's document.

Is there a good way to work this out?

beedrill
  • 344
  • 3
  • 17
  • Typically, your programming stack has a solution for this -- not GitHub. For example, if you're using next.js or react, here's an answer for you: https://stackoverflow.com/a/71587793/1080523 – rethab Apr 08 '22 at 05:57
  • @rethab Thank you. The link you shared essentially says there are some other .env files that will be tracked by the repo. That probably can solve the dev/production configuration issue but is not really customizable. In fact, to allow a programming stack to solve this, they must have some kind of mechanism to provide otherwise no programming stack can include a local configuration into the online build. – beedrill Apr 08 '22 at 15:15

0 Answers0