Skip to content

Commit

Permalink
Use single workflow for building and deploying (master only)
Browse files Browse the repository at this point in the history
  • Loading branch information
epistrephein committed Oct 8, 2023
1 parent a27aae9 commit bbc4279
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 25 deletions.
25 changes: 22 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,35 @@
name: build

on: [push]
on: push

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Run RSpec
run: bundle exec rake spec
- name: Run RuboCop
run: bundle exec rake rubocop
deploy:
runs-on: ubuntu-latest
needs: build
if: github.ref_name == 'master'
steps:
- name: Install SSH key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.SSH_PRIVATE_KEY }}
known_hosts: ${{ secrets.SSH_KNOWN_HOSTS }}
- name: Connect and update
run: |
ssh ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} -p${{ secrets.SSH_PORT }} \
"cd ${{ secrets.SSH_WORKING_DIR }} && \
git pull && \
bundle install && \
sudo systemctl restart rubies"
22 changes: 0 additions & 22 deletions .github/workflows/deploy.yml

This file was deleted.

0 comments on commit bbc4279

Please sign in to comment.