Workflow#
See also
Environment for environment configuration. Getting Up and Running Locally With Docker for guide on docker setup.
Create the required environment files under
LOCAL_ENV.Update
ci.ymlto export these variables dynamically. Below is example.mkdir -p .envs/.local touch .envs/.local/.sample echo SECRET_1=${{ secrets.SECRET_1 }} >> .envs/.local/.sample echo SECRET_2=${{ secrets.SECRET_2 }} >> .envs/.local/.sampleNote
For every file under
LOCAL_ENV. Add those secrets to respective files. Using multiple echo commands for each and every env file.touch .envs/.local/.sample_file_1 echo SECRET_1=${{ secrets.SECRET_1 }} >> .envs/.local/.sample_file_1 touch .envs/.local/.sample_file_2 echo SECRET_4=${{ secrets.SECRET_4 }} >> .envs/.local/.sample_file_2Update the env file location in
local.yml.To add the secrets defined under
LOCAL_ENVto github actions either usepre-commithook or upload manually.
Using Pre-commit Hook#
pre-commit should be installed on your local machine, and then:
$ pre-commit install $ pre-commit install --hook-type pre-push
The
pre-commitpre-pushhook uploads the secrete to github actions when ONLYpushoperation is performed.Under hood it runs
python base/secrets_updater/main.py
Uploading Manually#
Run
python base/secrets_updater/main.pywhich will automatically upload all secrets.
Note
All secretes will be either created or overridden as per GitHub API. Update action make take a while based upon the total number of environment secrets.