extract athlete results and volunteering on separate pages in admin p… #1194
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "CI-CD" | |
on: | |
push: | |
branches: [ "master" ] | |
pull_request: | |
branches: [ "master" ] | |
jobs: | |
security: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Install Ruby and gems | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: 3.2.2 | |
bundler-cache: true | |
- name: Security audit dependencies | |
run: bundle exec bundler-audit --update | |
- name: Security audit application code | |
run: bundle exec brakeman -q -w2 | |
lint: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Install Ruby and gems | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: 3.2.2 | |
- name: Install packages | |
run: bundle | |
- name: Lint Ruby files | |
run: rubocop --parallel | |
test: | |
needs: | |
- security | |
- lint | |
runs-on: ubuntu-22.04 | |
services: | |
postgres: | |
image: postgres:14.3-alpine | |
ports: | |
- "5432:5432" | |
env: | |
POSTGRES_DB: rails_test | |
POSTGRES_USER: rails | |
POSTGRES_PASSWORD: password | |
env: | |
CI: true | |
RAILS_ENV: test | |
DATABASE_URL: "postgres://rails:password@localhost:5432/rails_test" | |
TZ: "Europe/Moscow" | |
COVERAGE: on | |
BULLET_ENABLED: true | |
APP_HOST: "test.ru" | |
ADMIN_EMAIL: "admin@test.ru" | |
INFO_EMAIL: "info@test.ru" | |
VK_TOKEN: ${{ secrets.VK_TOKEN }} | |
VK_GROUP_ID: 212432495 | |
BOT_TOKEN: "123456:test" | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Install Ruby and gems | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: 3.2.2 | |
bundler-cache: true | |
- name: Set up database schema | |
run: bin/rails db:schema:load | |
- name: Check database consistency | |
run: bundle exec database_consistency | |
- name: Rspec tests | |
if: github.ref != 'refs/heads/master' | |
run: bundle exec rspec | |
- name: Test & publish code coverage | |
if: github.ref == 'refs/heads/master' | |
uses: paambaati/codeclimate-action@v3.2.0 | |
env: | |
CC_TEST_REPORTER_ID: ${{ secrets.CODECLIMATE }} | |
with: | |
coverageCommand: bundle exec rspec | |
deploy: | |
if: github.ref == 'refs/heads/master' | |
needs: | |
- test | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Install Ruby and gems | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: 3.2.2 | |
bundler-cache: true | |
- name: Deploy | |
uses: miloserdow/capistrano-deploy@master | |
with: | |
target: production | |
deploy_key: ${{ secrets.DEPLOY_ENC_KEY }} | |
env: | |
APP_NAME: ${{ secrets.APP_NAME }} | |
APP_REPO: ${{ secrets.APP_REPO }} | |
DEPLOY_HOST: ${{ secrets.DEPLOY_HOST }} | |
DEPLOY_USER: ${{ secrets.DEPLOY_USER }} | |
APP_DEPLOY_PATH: ${{ secrets.APP_DEPLOY_PATH }} |