Skip to content

Commit

Permalink
split CI
Browse files Browse the repository at this point in the history
  • Loading branch information
AndriiKhomik committed Nov 21, 2024
1 parent f73b6d8 commit bbc5c99
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: CI
name: Rspec

on:
workflow_run:
workflows:
- Rubocop
push:

pull_request:
Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/production.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Production

on:
branches:
- master

release:
types: [published]

jobs:
deploy-to-production:
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/checkout@v2

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

- uses: miloserdow/capistrano-deploy@v3
with:
target: production
deploy_key: ${{ secrets.PROD_DEPLOY_KEY }}
18 changes: 18 additions & 0 deletions .github/workflows/rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Rubocop

on:
push:

jobs:
rubocop:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3.5
bundler-cache: true
cache-version: 1
- name: Run rubocop
run: |
bundle exec rubocop
26 changes: 26 additions & 0 deletions .github/workflows/staging.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Staging

on:
branches:
- develop
types:
- closed

jobs:
deploy-to-staging:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == true
steps:
- uses: actions/checkout@v2

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

- uses: miloserdow/capistrano-deploy@v3
with:
target: staging
deploy_key: ${{ secrets.STAGING_KEY_PASSWORD }}
enc_rsa_key_pth: config/credentials/staging_deploy_id_ed25519_enc

0 comments on commit bbc5c99

Please sign in to comment.