This GitHub Action allows for simple creation of envvars.config
files for AWS
Elastic Beanstalk deployments.
- Flexible Configuration: Accepts JSON inputs and environment variable definitions directly in the workflow.
- Customizable File Placement: Allows setting the directory and filename for the configuration file.
- Sorting: Optionally sorts environment variable keys alphabetically.
- Error Handling: Can be configured to fail the action if any environment variable is empty.
filename
: The filename for the environment file. Default isenvvars.config
.directory
: The directory to place the environment file. Default is.ebextensions
.fail_on_empty
: Whether to fail the action if an environment variable is empty. Default isfalse
.sort_keys
: Sort the keys alphabetically. Default isfalse
.json
: JSON representation of your environment variable key/values.ebx_${VARIABLE_NAME}
: In addition to using json, you can also define your variables directly in yaml using theebx_
prefix.
result
: An ebextensions envvars.config file
option_settings:
- option_name: VARIABLE_1
value: value_1
- option_name: VARIABLE_2
value: value_2
To use this action with JSON configuration in your workflow, add the following step:
steps:
- name: Generate EnvVars Config
uses: basaldev/beanstalk-envs-action@main
with:
json: '{"API_KEY": "your_api_key", "OTHER_VAR": "some_value"}'
directory: '.ebextensions'
filename: 'envvars.config'
fail_on_empty: 'true'
sort_keys: 'true'
option_settings:
- option_name: API_KEY
value: your_api_key
- option_name: OTHER_VAR
value: some_value
You can also mix JSON with direct environment variable settings in your GitHub Actions workflow:
steps:
- name: Generate EnvVars Config
uses: basaldev/beanstalk-envs-action@main
with:
json: '{"API_KEY": "your_api_key"}'
ebx_MY_VARIABLE: '123'
directory: '.ebextensions'
filename: 'envvars.config'
fail_on_empty: 'true'
sort_keys: 'true'
option_settings:
- option_name: API_KEY
value: your_api_key
- option_name: MY_VARIABLE
value: 123
Contributions to the Beanstalk Env Action are welcome! Please read our contributing guidelines to get started.
This project is licensed under the MIT License - see the LICENSE file for details.