EN-7354 create rather than build #775
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
# @see https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby | |
# @see https://www.pibit.nl/github/actions/rails/postgres/rspec/tutorial/example/2019/09/23/github-actions-with-rails-postgres-and-rspec/ | |
name: Ruby | |
on: | |
push: | |
branches: [ master ] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
services: | |
db: | |
image: mdillon/postgis:11 | |
ports: ['5432:5432'] | |
env: | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: postgres | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
redis: | |
image: redis | |
options: --entrypoint redis-server | |
ports: ['6379:6379'] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: 3.1.0 | |
bundler-cache: true # runs 'bundle install' and caches installed gems automatically | |
- name: Setup Database | |
run: | | |
cp config/database.yml.github-actions config/database.yml | |
bundle exec rake db:drop db:create db:migrate | |
env: | |
RAILS_ENV: test | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: postgres | |
- name: Run tests | |
env: | |
RAILS_ENV: test | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: postgres | |
REDIS_URL: redis://redis:6379 | |
run: bundle exec rake | |
- uses: akhileshns/heroku-deploy@v3.8.9 | |
with: | |
heroku_api_key: ${{secrets.HEROKU_API_KEY}} | |
# deploy to entourage-back | |
heroku_app_name: entourage-back | |
heroku_email: nicolas.chafai@entourage.social |