-
Notifications
You must be signed in to change notification settings - Fork 3
48 lines (44 loc) · 1.21 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
39
40
41
42
43
44
45
46
47
48
name: Deploy DGIdb
on:
workflow_call:
inputs:
environment:
required: true
type: string
secrets:
SSH_HOST:
required: true
SSH_KEY:
required: true
jobs:
deploy:
name: Capistrano Deploy to Server
runs-on: ubuntu-latest
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'
if_key_exists: replace
config: |
host ${{ secrets.SSH_HOST }}
IdentityFile ~/.ssh/github-actions
IdentitiesOnly yes
ForwardAgent yes
- name: Adding Known Hosts
run: ssh-keyscan -H ${{ secrets.SSH_HOST }}
- uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
working-directory: ./server
ruby-version: '3.1'
bundler-cache: true
- name: Deploy
working-directory: ./server
run: |
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/github-actions
bundle exec cap ${{ inputs.environment }} deploy