name: "CI"
on: [push, pull_request]

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-java@v1
        with:
          java-version: 11
      - run: chmod +x gradlew
      - run: ./gradlew check --stacktrace
  deploy:
    needs: build
    runs-on: ubuntu-latest
    if: github.event_name == 'push'
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-java@v1
        with:
          java-version: 11
      - run: chmod +x gradlew
      - run: ./gradlew assemble
      - env:
          HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
        run: heroku plugins:install java
      - env:
          HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
        run: heroku deploy:jar build/libs/traintracker.jar --app traintracker-io --options -Dspring.liquibase.enabled=true

name: "CI"
on: [push, pull_request]

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-java@v1
        with:
          java-version: 11
      - run: chmod +x gradlew
      - run: ./gradlew check --stacktrace
  deploy:
    needs: build
    runs-on: ubuntu-latest
    if: github.event_name == 'push'
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-java@v1
        with:
          java-version: 11
      - run: chmod +x gradlew
      - run: ./gradlew assemble
      - env:
          HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
        run: heroku plugins:install java
      - env:
          HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
        run: heroku config:set SPRING_LIQUIBASE_ENABLED=true --app traintracker-io
      - env:
          HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
        run: heroku deploy:jar build/libs/traintracker.jar --app traintracker-io
      - env:
          HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
        run: heroku config:unset SPRING_LIQUIBASE_ENABLED --app traintracker-io

Test running Liquibase only on deploy
Test running Liquibase only on deploy
