Skip to content

Commit

Permalink
remove unused code, add dependency to staging and production
Browse files Browse the repository at this point in the history
  • Loading branch information
AndriiKhomik committed Nov 21, 2024
1 parent bbc5c99 commit ff2d711
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 59 deletions.
59 changes: 0 additions & 59 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,7 @@ on:
- Rubocop
push:

pull_request:
branches:
- develop
- master
types:
- closed

release:
types: [published]

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
rspec:
needs: rubocop
runs-on: ubuntu-latest
Expand Down Expand Up @@ -95,40 +73,3 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
json-path: tmp/rspec_results.json
if: always()

deploy-to-staging:
needs: rspec
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

deploy-to-production:
needs: rspec
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 }}
4 changes: 4 additions & 0 deletions .github/workflows/production.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: Production

on:
workflow_run:
workflows:
- Rspec

branches:
- master

Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/staging.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: Staging

on:
workflow_run:
workflows:
- Rspec

branches:
- develop
types:
Expand Down

0 comments on commit ff2d711

Please sign in to comment.