diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..c57e324 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,34 @@ +name: Node.js CI + +# This defines when the automation runs +on: + push: + branches: [ "main" ] # Runs when you push to main + pull_request: + branches: [ "main" ] # Runs when someone sends a PR + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' # You can change this to your preferred version + cache: 'npm' + + - name: Install dependencies + run: npm install + + - name: Build project + run: npm run build + + # - name: Run typechecks + # run: npm run typecheck -y + + - name: Verify production run + run: npm run test -y \ No newline at end of file diff --git a/package.json b/package.json index f999d95..0952b76 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,8 @@ "private": true, "scripts": { "build": "nuxt build", + "typecheck": "nuxt typecheck", + "test": "npm run typecheck && npm run build", "dev": "nuxt dev", "generate": "nuxt generate", "prod": "nuxt build && node .output/server/index.mjs",