Environment Vars Action
The Environment Vars Action lists, sets and deletes environment variables on a Quant Cloud environment.
Repository: quantcdn/quant-cloud-environment-var-action (latest release v1.0.2)
Inputs
Section titled “Inputs”| Input | Required | Default | Description |
|---|---|---|---|
api_key |
Yes | Quant API key | |
organization |
Yes | Organisation machine name | |
app_name |
Yes | Application name | |
environment_name |
Yes | Environment name | |
base_url |
No | https://dashboard.quantcdn.io |
QuantGov: https://dash.quantgov.cloud. Do not add /api/v3 |
operation |
No | list |
list, set, clear (delete every variable) or delete |
replace |
No | false |
set only: replace the whole list, removing variables that are not in the input |
env_file |
No | set: path to a .env file |
|
json_vars |
No | set: a JSON object of variables |
|
variables |
No | set: KEY=VALUE pairs, separated by newlines or commas |
|
keys |
No | delete: keys to delete, separated by newlines or commas |
The variables input splits on commas as well as newlines, so a value that contains a comma is cut in two. Use json_vars for such values. When you use more than one source, they merge in the order env_file, json_vars, variables (the later value wins).
Outputs
Section titled “Outputs”| Output | Description |
|---|---|
variables |
JSON of all variables and their values (list) |
count |
Number of variables (list) |
updated_count |
Number of variables set (set) |
deleted_count |
Number of variables deleted (clear, delete) |
failed_count |
Number of variables that failed. A set with failures fails the step |
Basic Usage
Section titled “Basic Usage”- uses: quantcdn/quant-cloud-environment-var-action@v1 with: api_key: ${{ secrets.QUANT_API_KEY }} organization: ${{ secrets.QUANT_ORGANIZATION }} app_name: my-app environment_name: production base_url: https://dashboard.quantcdn.io # QuantGov: https://dash.quantgov.cloud operation: set variables: | APP_ENV=production LOG_LEVEL=info DEBUG=falseApply the change
Section titled “Apply the change”Running containers keep the values they started with. Redeploy after you change variables:
- uses: quantcdn/quant-cloud-environment-state-action@v4 with: api_key: ${{ secrets.QUANT_API_KEY }} organization: ${{ secrets.QUANT_ORGANIZATION }} application: my-app environment: production action: redeploy base_url: https://dashboard.quantcdn.ioWith Init Action
Section titled “With Init Action”- uses: quantcdn/quant-cloud-environment-var-action@v1 with: api_key: ${{ secrets.QUANT_API_KEY }} organization: ${{ secrets.QUANT_ORGANIZATION }} app_name: ${{ steps.init.outputs.quant_application }} environment_name: ${{ steps.init.outputs.environment_name }} base_url: https://dashboard.quantcdn.io operation: set variables: | APP_VERSION=${{ github.sha }} GIT_BRANCH=${{ github.ref_name }}Environment-Specific Variables
Section titled “Environment-Specific Variables”- uses: quantcdn/quant-cloud-environment-var-action@v1 if: steps.init.outputs.is_production == 'true' with: api_key: ${{ secrets.QUANT_API_KEY }} organization: ${{ secrets.QUANT_ORGANIZATION }} app_name: ${{ steps.init.outputs.quant_application }} environment_name: ${{ steps.init.outputs.environment_name }} base_url: https://dashboard.quantcdn.io operation: set variables: | APP_ENV=production LOG_LEVEL=warningNext Steps
Section titled “Next Steps”- Sync Action - Sync data between environments
- Managing Environment Variables (UI)
