-
Notifications
You must be signed in to change notification settings - Fork 62
Git push to heroku #10
Comments
Hi, @rickyhopkins, I'm having same problem here. Did you work around this in a clever way? |
Hey @deniscostadsc, Nope, my project does not change too often so I have resorted to a manual deploy until I can get this working. The only workaround that I found was here which suggests adding the Heroku remote manually with the API key injected in like so: - name: Add remote origin
run: |
git remote add heroku https://heroku:${{ secrets.HEROKU_API_KEY }}@git.heroku.com/${{ secrets.HEROKU_APP_NAME }}.git
- name: Deploy to Heroku
run: |
git push heroku HEAD:master -f I did not test this myself but I can't see why it wouldn't work it just feels like a bit of a hack to me. Hope that helps. |
You don’t need the remote step so for my project, this is the solution I’m using: - name: Deploy to production
run: |
git push https://heroku:$HEROKU_API_KEY@git.heroku.com/<heroku-project>.git master |
I tried an approach similar to yours, but I keep getting errors. I even tried to put hardcode URL with secret API key (don't worry I already invalidated it 😎) and got same error bellow:
|
Is the branch that ran the workflow master? If not, you can try changing |
After changing my code to this:
I start to get this error:
I think my error is more related to git that Heroku actually. Thanx for the help so far. |
Just for the sake of history, my problem seems to be caused by the state of detached of the repo on build. I'm confused why you didn't have this problem. |
Yes, it was the detached state. I used a semi-hacky solution of creating a branch before pushing to github. |
o/ for other people looking for an example with Heroku git push deploy on pull request with a comment |
@deniscostadsc do you have a sample yaml file for that hacky solution that you mentioned? |
I am trying to deploy to heroku with github actions using actions/heroku@master. I am not using docker so the standard directions for the heroku action does not really apply to me.
My current flow is:
It seems to login just fine and it adds the remote but then it fails when I try to push to heroku with the following message:
fatal: could not read Username for 'https://git.heroku.com': No such device or address
Which seems strange because the heroku login command should be adding my credentials to the .netrc file.
The text was updated successfully, but these errors were encountered: