【发布时间】:2018-12-28 22:54:01
【问题描述】:
我正在处理一个我想在 GitHub 页面中发布的项目。为了自动化部署过程,我使用了Travis CI。为此,我创建了一个 deploy.sh 文件,其中包含以下代码。
# build
npm run docs:build
# navigate into the build output directory
cd docs/.vuepress/dist
# if you are deploying to a custom domain
# echo 'www.example.com' > CNAME
git add -A
git commit -m 'deploy'
# if you are deploying to https://<USERNAME>.github.io
# git push -f git@github.com:<USERNAME>/<USERNAME>.github.io.git master
# if you are deploying to https://<USERNAME>.github.io/<REPO>
git push -f git@github.com:<username>/<repo>.git master:gh-pages
cd -
我已将其添加到我的 .travis.yml 文件中,该文件位于以下
language: nodejs
node_js:
- "lts/*"
before_script:
- npm install
script:
- bash ./scripts/deploy.sh
现在,当我将代码推送到主服务器时,在 travis-ci.org 中显示构建失败,输出如下,
Warning: Permanently added the RSA host key for IP address '192.30.253.113' to the list of known hosts.
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
The command "bash ./scripts/deploy.sh" exited with 128.
我已经关注了类似 link 的其他类似错误的 SO 答案,还关注了 the way 生成 ssh 密钥并将其添加到我的 GitHub 帐户,但没有成功。如果您能帮助我,我将不胜感激。谢谢。
【问题讨论】:
标签: node.js github ssh continuous-integration travis-ci