Skip to content

Commit

Permalink
Update ci.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielVajnagi authored Nov 22, 2024
1 parent d3f88fb commit e35f8fa
Showing 1 changed file with 54 additions and 6 deletions.
60 changes: 54 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@ name: CI
on:
push:

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

release:
types: [published]

jobs:
rubocop:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -50,16 +60,17 @@ jobs:
with:
ruby-version: 3.3.5
bundler-cache: true


- name: Update packages
run: sudo apt-get update

- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y libvips42 libvips-dev imagemagick
run: sudo apt-get install -y libvips42 libvips-dev imagemagick

- uses: actions/setup-node@v1
with:
node-version: '14.x'
registry-url: 'https://registry.npmjs.org'
node-version: "14.x"
registry-url: "https://registry.npmjs.org"

- uses: nanasess/setup-chromedriver@master

Expand All @@ -81,3 +92,40 @@ 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 }}

0 comments on commit e35f8fa

Please sign in to comment.