diff --git a/.github/workflows/api_build.yaml b/.github/workflows/api_build.yaml new file mode 100644 index 00000000..4d12c18d --- /dev/null +++ b/.github/workflows/api_build.yaml @@ -0,0 +1,44 @@ +name: Build API + +on: + - push + - pull_request + - workflow_dispatch + +jobs: + install: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install Node.js + uses: actions/setup-node@v4 + with: + node-version: 18 + + - uses: pnpm/action-setup@v4 + name: Install pnpm + with: + version: 8 + run_install: false + + - name: Get pnpm store directory + shell: bash + run: | + echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV + + - uses: actions/cache@v4 + name: Setup pnpm cache + with: + path: ${{ env.STORE_PATH }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store- + + - name: Install dependencies + run: pnpm install + + - name: Build + run: pnpm api:build diff --git a/package.json b/package.json index c9358992..84b25a28 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,8 @@ "license": "GPL-3.0", "workspaces": ["apps/*", "packages/*"], "scripts": { + "api:dev": "pnpm --filter @6pm/api run dev", + "api:build": "pnpm --filter @6pm/api run build", "api:start": "pnpm --filter @6pm/api run start" }, "devDependencies": {