-
Notifications
You must be signed in to change notification settings - Fork 0
36 lines (33 loc) · 1.03 KB
/
deployment.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
name: Deploy to production
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: "Checkout repository"
uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/[email protected]
with:
bundler-cache: true
ruby-version: 3.0.3
- name: Install SSH key
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_KEY }}
- name: Add known host
run: |
ssh-keyscan -p ${{ secrets.DEPLOY_HOST_SSH_PORT }} ${{ secrets.DEPLOY_HOST }} >> ~/.ssh/known_hosts
- name: Test SSH connection
run: |
ssh -vvv ${{ secrets.DEPLOY_USERNAME }}@${{ secrets.DEPLOY_HOST }} -p${{ secrets.DEPLOY_HOST_SSH_PORT }}
- name: Deploy
env:
DEPLOY_HOST: ${{ secrets.DEPLOY_HOST }}
DEPLOY_USERNAME: ${{ secrets.DEPLOY_USERNAME }}
DEPLOY_HOST_SSH_PORT: ${{ secrets.DEPLOY_HOST_SSH_PORT }}
run: |
bundle exec cap production deploy