我正在尝试使用grunt-gh-pages扩展来提交我的 gh-branch。它在本地运行良好,但是当我使用 TRAVIS-CI 时它失败了。它给出以下错误消息 -
Warning: fatal: remote error:
You can't push to git://github.com/tusharmath/tusharm.com.git
Use https://github.com/tusharmath/tusharm.com.git
Use --force to continue.
当我更新 repo 选项时,我收到以下错误 -
Warning: remote: Anonymous access to tusharmath/tusharm.com.git denied.
fatal: Authentication failed for 'https://github.com/tusharmath/tusharm.com.git/'
Use --force to continue.
Aborted due to warnings.
所以基本上我只想让 Travis-ci 提交我的 repo 的 gh-pages 分支中的文件。有没有办法做到这一点?
更新.travis.yml
解决问题的final
language: node_js
node_js:
- '0.11'
before_script:
- git config --global user.email "tusharmath@gmail.com"
- git config --global user.name "Travis-CI"
after_script:
- git config credential.helper "store --file=.git/credentials"
- echo "https://${GH_TOKEN}:@github.com" > .git/credentials
- node ./node_modules/grunt-cli/bin/grunt release
env:
global:
secure: {"lots-of-seemingly-random-characters"}