name: build

on: [push, pull_request]

jobs:
  test:
    runs-on: ubuntu-latest
    services:
      postgres:
        image: postgres:12
        env:
          POSTGRES_HOST_AUTH_METHOD: trust
        ports:
          - 5432:5432
        options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
    steps:
    - uses: actions/checkout@v2
    - uses: ruby/setup-ruby@v1
    - run: sudo apt-get -yqq install libpq-dev
    - run: gem install bundler
    - run: bundle install --jobs 4 --retry 3
    - run: bundle exec rake
      env:
        DATABASE_URL: postgres://postgres@postgres/postgres

  publish:
    needs: test
    if: github.event_name == 'push'
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - uses: elgohr/Publish-Docker-Github-Action@2.14
      with:
        name: hakanensari/frankfurter
        username: ${{ secrets.DOCKER_USERNAME }}
        password: ${{ secrets.DOCKER_PASSWORD }}
        tag_names: true

name: build

on: [push, pull_request]

jobs:
  test:
    runs-on: ubuntu-latest
    container:
       image: ruby:2.7.1
    services:
      postgres:
        image: postgres:12
        env:
          POSTGRES_HOST_AUTH_METHOD: trust
        ports:
          - 5432:5432
        options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
    steps:
    - uses: actions/checkout@v2
    - run: gem install bundler
    - run: bundle install --jobs 4 --retry 3
    - run: bundle exec rake
      env:
        DATABASE_URL: postgres://postgres@postgres/postgres

  publish:
    needs: test
    if: github.event_name == 'push'
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - uses: elgohr/Publish-Docker-Github-Action@2.14
      with:
        name: hakanensari/frankfurter
        username: ${{ secrets.DOCKER_USERNAME }}
        password: ${{ secrets.DOCKER_PASSWORD }}
        tag_names: true

Revert to using ruby image
Revert to using ruby image
