question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Problem in Enviromental Variables

See original GitHub issue

I have a lot of enivormental variables that I need to push to heroku. I have stored all these variables in an encrypted .env.gpg file which I am later decrypting in one of the steps and put it in the folder where the heroku action will take place. I need to pass this decrypted .env file to heroku. How can I do this?

name: Frontend Deploy

on:
  push:
    branches:
      - autodeploy

jobs:
  deploytoheroku:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Decrypt frontend.env
        run: ./.github/scripts/frontend_decrypt.sh
      - uses: akhileshns/heroku-deploy@v3.4.6
        with:
          heroku_api_key: ${{secrets.NEW_HEROKU_API_KEY}}
          heroku_app_name: "myapp"
          heroku_email: "email@email.com"
          branch: autodeploy
          appdir: frontend
      - run: echo "Deployed"

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
AkhileshNScommented, Sep 18, 2020

Hey @uinstinct, I’ve added the feature to pull env variables from a .env file. Please check the updated environmental variables part of the readme file here on how to do this.

Do let me know if this solves your issue and if it does, please close the issue

1reaction
AkhileshNScommented, Sep 18, 2020

No the Action won’t add and commit any changes before pushing it (Although I have been considering adding that since many of the issues coming up have been related to changes made before deployment not being recognized).

But you can just do that yourself by adding a run command to your workflow file before the deploy action that looks like this

run: git config user.name "USERNAME" && git config user.email "EMAIL" && git add -A && git commit -m "Added env file"

If you’re worried that the env file is in your .gitignore file then you won’t need to commit it at all and the action will still be able to read the file since it’s generated into the filesystem (once I add the feature)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Problems with Environment Variables
Environment variable is not set · Environment variable set to non-existent directory · Environment variable is not properly set.
Read more >
New Environment Variables Not Working in Windows 10
New Environment Variables Not Working in Windows 10. I am trying to put in paths to my php install and php composer. Here's...
Read more >
The error environment variable - IBM
The error environment variable is a special variable that holds data about Runtime Exception events. This variable is null until an exception happens....
Read more >
Environment variables: Should they be considered harmful?
“Environment variables are an essential part of how things run under unix/linux systems,” explained John Bambenek, manager of threat systems at Fidelis ...
Read more >
Windows 10 System environment variables don't stick
I am unable to update my system environment variable PATH. I don't receive any error message when editing PATH, but the change doesn't...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found