I started working on writing a script to deploy the ScholarX. I started extending the existing Github Action and was able to perform the heroku login
after numerous failures. The following script creates the .netrc
file which stores Heroku credentials.
cat > ~/.netrc <<EOF
machine api.heroku.com
login $HEROKU_EMAIL
password $HEROKU_API_KEY
machine git.heroku.com
login $HEROKU_EMAIL
password $HEROKU_API_KEY
EOF
With this file, we don’t need to run heroku login
.
Currently, I’m struggling with the next part which is to push the code to the heroku remote. Which fails due to some git failure.
This is the current code snippet which tries to commit the changes to the Heroku remote. But it’s failing and tried various changes but no luck.
git config --global user.name ${{secrets.USER_NAME}}
git config --global user.email ${{secrets.USER_EMAIL}}
cd backend
git init
heroku git:remote --app $HEROKU_APP_NAME
git add .
git commit -m "Deploy"
git fetch --all --unshallow
git push heroku HEAD:maste
Here’s the whole workflow.
@piumal1999 can you find what’s wrong with this?