name: Deploy to Firebase Hosting on Workflow Dispatch
on:
  workflow_dispatch:
    inputs:
      channelId:
        required: true
        description: Name of channelId. If you set the live, action will deploy to production.
jobs:
  build_and_preview:
    runs-on: ubuntu-20.04
    steps:
      - uses: actions/checkout@v3
      - run: npm ci && npm run build
      - uses: FirebaseExtended/action-hosting-deploy@v0
        with:
          repoToken: "${{ secrets.GITHUB_TOKEN }}"
          firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT }}"
          projectId: scrap-conan-online
          channelId: ${{ github.event.inputs.channelId }}
        env:
          FIREBASE_CLI_PREVIEWS: hostingchannels
