name: Deploy to Firebase
on:
  push:
    branches: [ develop ]

defaults:
  run:
    working-directory: web
    
jobs:
  build_and_deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-node@v1
        with:
          node-version: 16
      - run: yarn install --frozen-lockfile
      - run: yarn build
      - uses: FirebaseExtended/action-hosting-deploy@v0
        with:
          entryPoint: .
          repoToken: '${{ secrets.GITHUB_TOKEN }}'
          firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_RADIO_OTHERWAY }}'
          channelId: live
          projectId: radio-otherway
