Understanding .env. docker compose and Github Actions #1410
-
First Check
Commit to Help
Example Code
DescriptionI am having trouble understanding how to deal with Github Actions and the docker-compose files. I am opening this discussion with the hope that somebody will provide more information about how this repo is meant to be used. I see that the Currently I am not yet ready to have a domain so I am focused only on local developing. I would be very interested to know how you guys manage the Github Actions on your personal projects which are based on this repo. I would also like to know if there is a Discord Server where such discussions can take place. Operating SystemmacOS Operating System Details15.0.1 (24A348) Python VersionPython 3.12.5 Additional ContextNo response |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Normally the .env shouldn't be posted in public repositories, but given the context of this project the .env has been made available in the repository. The .env in this case does not have any critical and strictly private keys. Since the .env is in the repository, when the workflow runs, the first step is to clone the repository into the workflow's workspace. After the checkout step then the entire repository is available for the subsequent steps. This means that the workflow's workspace has the .env available, making it succeed. If you want to use it in private repositories, I think you have to setup GitHub Actions Secrets and update the workflow to use your repository secrets. |
Beta Was this translation helpful? Give feedback.
I recently started using this template and came across this use case myself. Even though my repository is private (for the time being), I still didn't like the idea that the
.env
file was committed to and available in source control.I tried a couple of approaches to solving this, which I'll outline below.
Approach 1 - Utilize GitHub Actions Secrets
As @gdoda mentioned above, setting up the corresponding GitHub Actions secrets for your repository could be one way to get the workflows running without a main
.env
file available. First, you will need to add the secrets to the Settings --> Secrets and variables --> Actions page of your repository:After adding the secrets in the GitHub setti…