name: CI/CD Pipeline

on:
  push:
    branches:
      - develop
      - main
  pull_request:
    # Run workflow whenever a PR is opened, updated (synchronized), or marked ready for review.
    types: [ opened, synchronize, ready_for_review ]

jobs:

  lint:
    name: Lint
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v2

      - name: Get npm cache directory
        id: npm-cache
        run: echo "::set-output name=dir::$(npm config get cache)"

      - name: Configure npm cache
        uses: actions/cache@v2
        with:
          path: ${{ steps.npm-cache.outputs.dir }}
          key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
          restore-keys: |
            ${{ runner.os }}-npm-

      - name: Install Node dependencies
        run: npm i
        env:
          CI: true

      - name: Detect coding standard violations
        run: npm run lint

  deploy:
    if: github.ref == 'refs/heads/develop'
    needs: [lint]
    name: Deploy
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v2

      - name: Deploy to Firebase
        uses: FirebaseExtended/action-hosting-deploy@v0
        with:
          repoToken: "${{ secrets.GITHUB_TOKEN }}"
          firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT }}"
          projectId: web-dev-media
          channelId: live

Add action workflow with lint & deploy
Add action workflow with lint & deploy
