Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
miloserdow authored Oct 31, 2019
1 parent 1ff02f2 commit facded9
Showing 1 changed file with 53 additions and 2 deletions.
55 changes: 53 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,55 @@
# capistrano-actions
# Capistrano actions
Github Actions for Capistrano.

Currently only deploy action is supported.
Currently deploy action is supported.

## Inputs
### `target`
Environment where deploy is to be performed to. E.g. "production", "staging". Default value is empty

### `deploy_key`
**Required** Symmetric key to decrypt private RSA key. Must be a string.

### `enc_rsa_key_pth`
**Required** Path to the encrypted key. Default `"config/deploy_id_rsa_enc"`.

## Outputs
No outputs

## Setting up CD using this action
1. Generate SSH keys on the target machine
```bash
$ ssh-keygen
```
2. Export public key to the `authorized_keys` to allow the usage of this keypair to login
```bash
$ cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
```
3. Add public key from `~/.ssh/id_rsa.pub` to your repository's deployment keys via *Settings / Deploy keys / Add*
4. Encrypt your private key with a strong password. **Please use these options**, otherwise this action may not be able to decrypt your key.
```bash
$ openssl enc -aes-256-cbc -md sha512 -salt -in .ssh/id_rsa -out deploy_id_rsa_enc -k PASSWORD -a
```
5. Add `deploy_id_rsa_enc` file to your repository. Suggested path is `config/deploy_id_rsa_enc`
6. Save the password used in step 4 as a secret in repository settings via *Settings / Secrets / Add*
7. Create YAML configuration for your workflow (example below)

## Workflow example
```yaml
name: deploy_production

on:
push:
branches:
- master

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: miloserdow/capistrano-actions/deploy@master
with:
target: 'production'
deploy_key: ${{ secrets.DEPLOY_ENC_KEY }}
```

0 comments on commit facded9

Please sign in to comment.