Skip to content

Commit 8c60e54

Browse files
committed
ci(travis): add the encrypted private deploy key
Add an encrypted SSH deploy key.
1 parent 7f52996 commit 8c60e54

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

.travis.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,24 @@ jobs:
88
- stage: test
99
node_js: node
1010

11+
- stage: release
12+
before_deploy:
13+
# Decrypt the git_deploy_key.enc key into /tmp/git_deploy_key
14+
- openssl aes-256-cbc -K $encrypted_5690340abf23_key -iv $encrypted_5690340abf23_iv -in git_deploy_key.enc -out /tmp/git_deploy_key -d
15+
# Make sure only the current user can read the private key
16+
- chmod 600 /tmp/git_deploy_key
17+
# Create a script to return the passphrase environment variable to ssh-add
18+
- echo 'echo ${SSH_PASSPHRASE}' > /tmp/askpass && chmod +x /tmp/askpass
19+
# Start the authentication agent
20+
- eval "$(ssh-agent -s)"
21+
# Add the key to the authentication agent
22+
- DISPLAY=":0.0" SSH_ASKPASS="/tmp/askpass" setsid ssh-add /tmp/git_deploy_key </dev/null
23+
deploy:
24+
provider: script
25+
skip_cleanup: true
26+
script:
27+
- echo "npx semantic-release"
28+
1129
notifications:
1230
email:
1331
on_success: never

git_deploy_key.enc

3.25 KB
Binary file not shown.

0 commit comments

Comments
 (0)