Skip to content

wip

wip #29

Workflow file for this run

name: main
on: ['push']
jobs:
tests:
name: Rspec
runs-on: ubuntu-latest
services:
postgres:
image: postgres
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: math_trainer_test
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
timeout-minutes: 10
steps:
- uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Run the tests
run: bundle exec rspec
env:
RAILS_ENV: test
DATABASE_URL: postgres://postgres:postgres@localhost:5432/math_trainer_test
deploy:
needs: tests
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
name: Deploy app on fly.io
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: superfly/flyctl-actions/setup-flyctl@master
- run: flyctl deploy --remote-only
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}