-
Notifications
You must be signed in to change notification settings - Fork 7
38 lines (34 loc) · 1.02 KB
/
deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
name: Run deploy
on:
push:
branches: [production]
jobs:
deploy:
name: Capistrano Deploy to Server
runs-on: ubuntu-20.04
steps:
- name: Install SSH key to Server
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.SSH_KEY }}
name: github-actions
known_hosts: 'random-placeholder-value-replaced-by-keyscan-below'
config: |
host ktom-tomi.or.id
IdentityFile ~/.ssh/github-actions
IdentitiesOnly yes
ForwardAgent yes
- name: Adding Known Hosts
run: ssh-keyscan -p "${{ secrets.SSH_PORT }}" "${{ secrets.SSH_HOST }}" >> ~/.ssh/known_hosts
- uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.5.3
- run: |
bundle install
- name: Deploy to production
run: |
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/github-actions
bundle exec cap production deploy --trace