name: Format, lint, typecheck & build

on:
    push:
        branches: ["master"]

jobs:
    check:
        runs-on: alpine
        container: node:lts-alpine

        steps:
            - name: Install dependencies
              run: apk add --no-cache git

            - name: Checkout repo
              uses: actions/checkout@v4

            - name: Install frontend deps
              working-directory: frontend
              run: npm install

            - name: Run eslint check
              working-directory: frontend
              run: npm run lint

            - name: Run typecheck
              working-directory: frontend
              run: npm run typecheck

            - name: Run Prettier check
              working-directory: frontend
              run: npx prettier --check .

            - name: Run build check
              working-directory: frontend
              run: npm run build
