name: deploy-production

on:
    push:
        branches: [main]

jobs:
    build-and-deploy:
        runs-on: ubuntu-latest
        steps:
            - uses: actions/checkout@v2
            - uses: actions/setup-node@v3
              with:
                  node-version: 16
            - run: |
                  npm ci
                  npm run build
            - uses: waymondrang/action-hosting-deploy@v1
              with:
                  repoToken: "${{ secrets.GITHUB_TOKEN }}"
                  firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT }}"
                  projectId: ieeeucsd-org
                  channelId: live
