Skip to content
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

Add environment variables using action inputs #20

Open
amira-d opened this issue Apr 1, 2024 · 0 comments · May be fixed by #21
Open

Add environment variables using action inputs #20

amira-d opened this issue Apr 1, 2024 · 0 comments · May be fixed by #21
Labels
enhancement New feature or request

Comments

@amira-d
Copy link

amira-d commented Apr 1, 2024

In some cases, an environment variable is necessary for the app to deploy/run correctly (e.g DB credentials).
I suggest adding a separate step right after creating the app that might look like this.
The condition for when to run this step can also depend on whether any ENV_VARIABLEs have been configured

- name: Set up DE application environment
        shell: bash
        if: github.event.action != 'closed'
        run: |
          IFS = $VAR_SEPERATOR
          for env in $(read -ra env <<< $ENV_VARIABLES) ; do
          de --no-keyfile apps update --name  ${{ env.APP_NAME }} --add-environment-variable $env
          done
        env:
          DASH_ENTERPRISE_HOST: ${{ vars.DASH_ENTERPRISE_URL }}
          DASH_ENTERPRISE_USERNAME: ${{ vars.DASH_ENTERPRISE_USERNAME }}
          DASH_ENTERPRISE_PASSWORD: ${{ secrets.DASH_ENTERPRISE_PASSWORD }}
          APP_NAME: ${{ vars.APP_NAME }}
          ENV_VARIABLES: ${{ secrets.ENV_VARIABLES }}
          VAR_SEPERATOR: ${{ vars.VAR_SEPERATOR }}
@amira-d amira-d added the enhancement New feature or request label Apr 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant