name: Build and deploy project
on:
  push:
    branches:
      - main
env:
  CONTAINER_REGISTRY: schmelczera

jobs:
  build-project:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout current branch with lfs
        uses: actions/checkout@master
        with:
          lfs: true
      - name: Build project
        run: |
          npm i && npm run init && npm run build
      - name: Deploy frontend
        uses: w9jds/firebase-action@master
        with:
          args: deploy --only hosting --project decla-red
        env:
          FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
          PROJECT_PATH: frontend
