配置GitLab CI部署到heroku

时间:2019-06-10 17:27:04

标签: heroku continuous-integration gitlab

我正在尝试设置我的GitLab CI,以将演示代码部署到Heroku,我在网上阅读了一些文章,但是遇到了一些问题

这是我收到的错误(来自GitLab CI):

$ git remote add heroku https://heroku:$HEROKU_API_KEY@git.heroku.com/MyApp.git
$ git push -f heroku master
error: src refspec master does not match any.
error: failed to push some refs to 'https://heroku:MyAPI@git.heroku.com/MyApp.git'

这是我的.gitlab-ci.yml文件的一部分:

deployment:
  stage: deploy
  script:
  - git remote add heroku https://heroku:$HEROKU_API_KEY@git.heroku.com/MyApp.git
  - git push heroku master

2 个答案:

答案 0 :(得分:0)

您只需要在推入之前提交即可。

答案 1 :(得分:0)

以下命令将解决您的问题:

touch README
git add README

git add .
git commit -m 'reinitialized files'
git push origin master --force 
相关问题