diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 05b3114a8..f2b326da3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,9 @@ -name: CI +name: Rspec on: + workflow_run: + workflows: + - Rubocop push: pull_request: diff --git a/.github/workflows/production.yml b/.github/workflows/production.yml new file mode 100644 index 000000000..d361aec7d --- /dev/null +++ b/.github/workflows/production.yml @@ -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 }} diff --git a/.github/workflows/rubocop.yml b/.github/workflows/rubocop.yml new file mode 100644 index 000000000..cea8b37da --- /dev/null +++ b/.github/workflows/rubocop.yml @@ -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 diff --git a/.github/workflows/staging.yml b/.github/workflows/staging.yml new file mode 100644 index 000000000..dfd77a5ac --- /dev/null +++ b/.github/workflows/staging.yml @@ -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