.github/workflows/build.yml

Summary

Maintainability
Test Coverage
name: build
on:
  push:
    branches:
      - main
jobs:
  build-and-deploy:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout ๐Ÿ›Ž๏ธ
        uses: actions/checkout@v3

      - uses: pnpm/action-setup@v2
        name: Install pnpm ๐Ÿ“ฆ
        id: pnpm-install
        with:
          version: 8
          run_install: false

      - name: Get pnpm store directory ๐Ÿ“ฆ
        id: pnpm-cache
        shell: bash
        run: |
          echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT

      - uses: actions/cache@v3
        name: Setup pnpm cache ๐Ÿ“ฆ
        with:
          path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
          key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
          restore-keys: |
            ${{ runner.os }}-pnpm-store-

      - name: Install dependencies ๐Ÿ“ฆ
        run: pnpm install

      - name: Lint ๐Ÿงน
        run: pnpm run lint

      - name: Build ๐Ÿ”ง
        run: pnpm run build

      - name: Test ๐Ÿงช
        run: pnpm run coverage

      - name: Upload Coverage ๐Ÿ“Š
        uses: paambaati/codeclimate-action@v5.0.0
        env:
          CC_TEST_REPORTER_ID: ${{secrets.CC_TEST_REPORTER_ID}}
        with:
          coverageLocations: ${{github.workspace}}/coverage/clover.xml:clover

      - name: Build Docs ๐Ÿ“–
        run: |
          pnpm run docs

      - name: Deploy ๐Ÿš€
        uses: JamesIves/github-pages-deploy-action@4.1.5
        with:
          branch: gh-pages
          folder: docs