Skip to content

Bump rails from d75fdd1 to fe81d66 #45

Bump rails from d75fdd1 to fe81d66

Bump rails from d75fdd1 to fe81d66 #45

Workflow file for this run

name: Build and deploy
on: push
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
DOCKER_BUILDKIT: '1'
jobs:
rspec:
name: Run rspec
runs-on: ubuntu-latest
services:
postgres:
image: postgres:14
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ports:
- 5432:5432
# needed because the postgres container does not provide a healthcheck
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Setup Database
run: |
cp config/database.github-actions.yml config/database.yml
bundle exec rails db:create
bundle exec rails db:schema:load
env:
RAILS_ENV: test
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
- name: Run RSpec
run: |
bundle exec rails assets:precompile
COVERAGE=true bundle exec rspec
env:
RAILS_ENV: test
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
deploy:
environment: fly-deploy
if: github.ref == 'refs/heads/main'
# needs: [rspec]
name: Deploy app
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: superfly/flyctl-actions/setup-flyctl@master
- run: flyctl deploy