Skip to content

Commit

Permalink
Enable deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
smolnar committed Mar 22, 2024
1 parent f15f7e5 commit 36962e0
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 49 deletions.
48 changes: 0 additions & 48 deletions .github/workflows/cd.yml

This file was deleted.

40 changes: 39 additions & 1 deletion .github/workflows/ci.yml → .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI
name: CI & CD

on: [push]

Expand Down Expand Up @@ -89,3 +89,41 @@ jobs:
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
run: ./cc-test-reporter after-build --coverage-input-type simplecov --exit-code $?

deploy:
name: Deploy to Production
needs: [test]
if: github.ref == 'refs/heads/master'

runs-on: ubuntu-latest

steps:
- name: Install SSH key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.SSH_KEY }}
name: github-actions
known_hosts: '...'
config: |
host otvorenesudy.sk
IdentityFile ~/.ssh/github-actions
IdentitiesOnly yes
ForwardAgent yes
- name: Adding Known Hosts
run: ssh-keyscan -H ${{ secrets.SSH_HOST }}

- name: Checkout Branch
uses: actions/checkout@v2

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3.0
bundler-cache: true

- name: Deploy
run: |
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/github-actions
bundle exec cap production deploy deploy:restart sidekiq:restart

0 comments on commit 36962e0

Please sign in to comment.