name: Build, Test & Publish to GitHub Pages

on:
  push:
    branches: [ master ]
  pull_request:

  # Allows you to run this workflow manually from the Actions tab
  workflow_dispatch:

jobs:
  build-and-deploy:
    concurrency: ci-${{ github.ref }}
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2
      
      - uses: actions/setup-node@v2
        with:
          node-version: 14

      - name: Install
        run: |
          npm ci
 
      - name: Test and Build
        run: |
          npm run test
          npm run prepare
      
      - name: Run LightHouse on static site
        run: |
          npm install -g @lhci/cli@0.8.x
          lhci autorun
        env:
          LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }}

      - name: Publish to GitHub Pages (if triggered from master)
        uses: JamesIves/github-pages-deploy-action@v4.3.2
        if: github.ref == 'refs/heads/master'
        with:
          branch: gh-pages
          folder: www/stencil-qrcode-component

name: Build, Test & Publish to GitHub Pages

on:
  push:
    branches: [ master ]
  pull_request:

  # Allows you to run this workflow manually from the Actions tab
  workflow_dispatch:

jobs:
  build-and-deploy:
    concurrency: ci-${{ github.ref }}
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2
      
      - uses: actions/setup-node@v2
        with:
          node-version: 14

      - name: Install
        run: |
          npm ci
 
      - name: Test and Build
        run: |
          npm run test
          npm run prepare
      
      - name: Run LightHouse on static site
        run: |
          npm install -g @lhci/cli@0.8.x
          lhci autorun
        env:
          LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }}

      - name: Publish to GitHub Pages (if triggered from master)
        uses: JamesIves/github-pages-deploy-action@v4.3.3
        if: github.ref == 'refs/heads/master'
        with:
          branch: gh-pages
          folder: www/stencil-qrcode-component

Update JamesIves/github-pages-deploy-action action to v4.3.3
Update JamesIves/github-pages-deploy-action action to v4.3.3
