我创建了我的.gitlab-ci.yml:
heroku:
stage: deploy
only:
- master
script:
- git remote add heroku https://heroku:$HEROKU_API_KEY@git.heroku.com/my-prohject-09034.git
- git push -f heroku master
我还在gitlab中创建了变量$HEROKU_API_KEY,并将其设置为protected。当我把我的代码推送到Gitlab时,它启动了pipleline,但它一直失败,我得到了这个错误:
**error: src refspec master does not match any.**
不确定问题出在哪里。
原来我不得不将.gitlab-ci.yml文件的最后一行更改为:
git push -f heroku HEAD:master