gem install travis
ssh-keygen -t rsa -b 4096 -f 'github_deploy_key' -N ''
cat github_deploy_key.pub
copy public key and set as a deploy key on github e.g https://github.com/<USER>/<REPOSITORY>/settings/keys
travis login --org --auto
travis encrypt-file 'github_deploy_key'
git add 'github_deploy_key.enc'
add openssl line to before_install stage in your .travis.yml
- replace
$encrypted_xxxxxxxxxxxx_key
and$encrypted_xxxxxxxxxxxx_iv
, see output oftravis encrypt-file
before_install:
- >-
openssl aes-256-cbc
-K $encrypted_xxxxxxxxxxxx_key
-iv $encrypted_xxxxxxxxxxxx_iv
-in github_deploy_key.enc
-out github_deploy_key
-d
- chmod 600 github_deploy_key
- eval $(ssh-agent -s)
- ssh-add github_deploy_key
git add '.travis.yml'
git commit -m 'chore: add github deploy key'
git push
Hi, thanks for the step-by-step.
I followed it and I got this error from Travis:
The command "openssl aes-256-cbc -K $encrypted_xxxxx_key -iv $encrypted_xxxxx_iv -in travis_deploy.enc -out travis_deploy -d" failed and exited with 1 during .
What might be the problem?