Search code examples
herokuyamldevopsgithub-actionscicd

Heoku Github actions deployement - CI/CD - Unable to push branch because the branch is behind the deployed branch


I am trying to build a CI/CD pipeline with github actions for a nodejs application after testing it it should be deployed to heroku, all the steps of github actions are executed successfully except for the last which is deploy to heroku.

The error I got is enter image description here

"16s Run akhileshns/[email protected] Created and wrote to ~./netrc › Warning: Our terms of service have changed: › https://dashboard.heroku.com/terms-of-service heroku: Press any key to open up the browser to login or q to exit: › Warning: heroku update available from 7.54.0 to 7.54.1. WARNING! Your password will be stored unencrypted in /home/runner/.docker/config.json. Configure a credential helper to remove this warning. See https://docs.docker.com/engine/reference/commandline/login/#credentials-store

Successfully logged into heroku › Warning: heroku update available from 7.54.0 to 7.54.1. Added git remote heroku › Warning: heroku update available from 7.54.0 to 7.54.1. ▸ No images to push

        Unable to push branch because the branch is behind the deployed branch. Using --force to deploy branch. 
        (If you want to avoid this, set dontuseforce to 1 in with: of .github/workflows/action.yml. 
        Specifically, the error was: Error: Command failed: heroku container:push web --app dsti-devops

› Warning: heroku update available from 7.54.0 to 7.54.1. ▸ No images to push

› Warning: heroku update available from 7.54.0 to 7.54.1. ▸ No images to push Error: Error: Command failed: heroku container:push web --app dsti-devops › Warning: heroku update available from 7.54.0 to 7.54.1. ▸ No images to push "

And here is the .yml file I used

enter image description here


Solution

  • Could you try using newest version of akhileshns/heroku-deploy. I also ran into the same issue, I used newer version and worked for me.