Skip to content

Commit

Permalink
feat(api): [CI] add CI action (#53)
Browse files Browse the repository at this point in the history
  • Loading branch information
duongdev committed Jun 8, 2024
1 parent 4484a8a commit 230a30f
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/api_build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Build API

on:
- push
- pull_request
- workflow_dispatch

jobs:
build_api:
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
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down

0 comments on commit 230a30f

Please sign in to comment.