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 49d6240
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/api_build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Build API

on:
- push
- pull_request
- workflow_dispatch

jobs:
build_api:
name: 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 49d6240

Please sign in to comment.