-
Notifications
You must be signed in to change notification settings - Fork 2
41 lines (33 loc) · 1 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
name: Deploy to staging
on:
push:
branches: [ main ]
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/[email protected]
- name: Set up Ruby
uses: ruby/[email protected]
with:
ruby-version: .ruby-version
bundler-cache: true
- name: Configure SSH
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Add server to known_hosts
run: |
mkdir -p ~/.ssh
ssh-keyscan -H ${{ secrets.STAGING_HOST }} >> ~/.ssh/known_hosts
- name: Set up Docker Buildx
id: buildx
uses: docker/[email protected]
- name: Deploy with Kamal
env:
RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }}
KAMAL_REGISTRY_PASSWORD: ${{ secrets.KAMAL_REGISTRY_PASSWORD }}
VERSION: ${{ github.sha }}
run: bundle exec kamal deploy --version=$VERSION