-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
✨ feat: Add support for environment variables in deployment action #21
base: main
Are you sure you want to change the base?
Conversation
I don't think I understand the proposed API; can you show a full example? |
in your deploy script you can add
which will then create the corresponding key/value environmental variables (separated by space) and add them into your app's Environment Variables. I just tested:
all work 💯 One note: |
@@ -55,6 +55,7 @@ The inputs this action uses are: | |||
| `create_redis` | `false` | None | True to create a Redis instance for the app. | | |||
| `create_postgres` | `false` | None | True to create a Postgres instance for the app. | | |||
| `create_persistent_filesystem` | `false` | None | True to create a persistent filesystem for the app. | | |||
| `env_vars` | `false` | None | Environment variables to add. Separate multiple variables with a space. Example: `env_vars: "FOO=BAR FOO_SECRET=${{ secrets.FOO_SECRET }}"` | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this work without quotation marks?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the current design, no. Without string, it would not be possible to split them. But er cam change it
To make it more transparent/less error prone, we can do this:
name: Deploy to Dash Enterprise
on:
push:
branches:
- main
jobs:
deploy:
name: 'Deploy to Dash Enterprise'
runs-on: ubuntu-latest
strategy:
matrix:
env_var:
- name: "FOO"
value: "BAR"
- name: "FOO_SECRET"
value: "${{ secrets.FOO_SECRET }}"
Or
name: Deploy to Dash Enterprise
on:
push:
branches:
- main
jobs:
deploy:
name: 'Deploy to Dash Enterprise'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: plotly/de-deploy@add-adding-env-variables
with:
env_vars: FOO=BAR FOO_SECRET=${{ secrets.FOO_SECRET }}
Or
name: Deploy to Dash Enterprise
on:
push:
branches:
- main
jobs:
deploy:
name: 'Deploy to Dash Enterprise'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: plotly/de-deploy@add-adding-env-variables
with:
env_vars: |
FOO=BAR
FOO_SECRET=${{ secrets.FOO_SECRET }}
(Note that | must be there)
What do you think?
This is a great addition. @danton267 Out of the alternative options you listed, I think I like the first one -- that would allow users to define each env var separately rather than passing them as a space-separated string, right? That feels overall easier to use and less error-prone. |
Agreed with @emilykl! Love the first option. |
@emilykl @ndrezn I've had a look at it, and it is not possible to GitHub
The best next thing we can do, is
Add it to The question is do you want
or
Is that ok? Or any thoughts about a different approach |
I prefer:
Would work without quotes too right? |
allows users to add env variables via setup
env_vars: "FOO=BAR FOO_SECRET=${{ secrets.FOO_SECRET }}"
Needs to be tested