You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
GitHub Action
Capistrano deploy
v2
Github deploy action for Capistrano. Use this action to automate your capistrano deployment process.
Ruby should be installed with official ruby action (https://github.com/actions/setup-ruby)
Environment where deploy is to be performed to. E.g. "production", "staging". Default value is empty
Required Symmetric key to decrypt private RSA key. Must be a string.
Required Path to the encrypted key. Default "config/deploy_id_rsa_enc"
.
No outputs
- Generate SSH keys on the target machine
$ ssh-keygen
- Export public key to the
authorized_keys
to allow the usage of this keypair to login
$ cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
- Add public key from
~/.ssh/id_rsa.pub
to your repository's deployment keys via Settings / Deploy keys / Add - Encrypt your private key with a strong password. Please use these options, otherwise this action may not be able to decrypt your key.
$ openssl enc -aes-256-cbc -md sha512 -salt -in .ssh/id_rsa -out deploy_id_rsa_enc -k PASSWORD -a
- Add
deploy_id_rsa_enc
file to your repository. Suggested path isconfig/deploy_id_rsa_enc
- Save the password used in step 4 as a secret in repository settings via Settings / Secrets / Add
- Create YAML configuration for your workflow (example below)
name: Deploy with Capistrano
on:
push:
branches:
- master
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up Ruby
uses: actions/setup-ruby@v1
with:
ruby-version: 2.6.5
- name: Restore Bundler cache
id: cache
uses: actions/cache@v1
with:
path: vendor/bundle
key: ${{ runner.os }}-bundle-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-bundle-
- uses: miloserdow/capistrano-deploy@v2
with:
target: production
deploy_key: ${{ secrets.DEPLOY_ENC_KEY }}