name: SvelteKit

on:
  push: { branches: [master] }
  pull_request:
    branches: [ "*" ]


jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - name: Check out 🚚
        uses: actions/checkout@v3
      
      - name: Extract frontend 🚜
        run: |
          shopt -s extglob
          rm -r !(frontend)/
          mv frontend/* ./

      - name: Install pnpm 📦
        uses: pnpm/action-setup@v2
        with:
          version: 7

      - name: Setup NodeJS ⚒️
        uses: actions/setup-node@v3
        with:
          node-version: 19
          cache: "pnpm"
          
      - name: Install dependencies 🚀
        run: pnpm install

      - name: Build 🔨
        run: pnpm run build

