name: Build
on: push
jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: php-actions/composer@v5
      - uses: php-actions/phpunit@v3
        with:
          php_extensions: zip
  deploy:
    runs-on: ubuntu-latest
    if: ${{ github.ref_name == 'master' }}
    needs: test
    steps:
      - uses: actions/checkout@v2
      - uses: akhileshns/heroku-deploy@v3.12.12
        with:
          heroku_api_key: ${{ secrets.HEROKU_API_KEY }}
          heroku_app_name: letterboxd-ical
          heroku_email: ${{ secrets.HEROKU_EMAIL }}
        env:
          HD_LETTERBOXD_USERNAME: ${{ secrets.LETTERBOXD_USERNAME }}
          HD_LETTERBOXD_PASSWORD: ${{ secrets.LETTERBOXD_PASSWORD }}

name: Build
on: push
jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: php-actions/composer@v5
      - uses: php-actions/phpunit@v3
        with:
          php_extensions: zip
  deploy:
    runs-on: ubuntu-latest
    if: ${{ startsWith(github.ref, 'refs/tags/v') }}
    needs: test
    steps:
      - uses: actions/checkout@v2
      - uses: akhileshns/heroku-deploy@v3.12.12
        with:
          heroku_api_key: ${{ secrets.HEROKU_API_KEY }}
          heroku_app_name: letterboxd-ical
          heroku_email: ${{ secrets.HEROKU_EMAIL }}
        env:
          HD_LETTERBOXD_USERNAME: ${{ secrets.LETTERBOXD_USERNAME }}
          HD_LETTERBOXD_PASSWORD: ${{ secrets.LETTERBOXD_PASSWORD }}

Switch workflow to deploy from tags
Switch workflow to deploy from tags
