Untitled

mail@pastecode.io avatar
unknown
yaml
a year ago
2.0 kB
9
Indexable
############################# .github/workflows/backend.yml

name: API CI

on:
  push:
    branches: [main]
    paths:
      - package.json
      - package-lock.json
      - ".github/**"
      - "workspaces/api/**"
  pull_request:
    branches: [main]
    paths:
      - package.json
      - package-lock.json
      - ".github/**"
      - "workspaces/api/**"

jobs:
  test:
    runs-on: ubuntu-latest

    strategy:
      matrix:
        node-version: [16.x, 18.x, 20.x]

    env:
      SECRET: ${{ secrets.SECRET }}

    steps:
      - uses: actions/checkout@v3

      - name: Use Node.js ${{ matrix.node-version }}
        uses: actions/setup-node@v3
        with:
          node-version: ${{ matrix.node-version }}

      - name: install dependencies
        run: npm ci --workspace api --no-audit --no-fund --quiet --include-workspace-root

      - name: run tests
        run: npm run api:test

  deploy:
    runs-on: ubuntu-latest
    needs: test
    if: github.ref == 'refs/heads/main'
    steps:
      - name: Deploy to render
        run: curl ${{ vars.DEPLOY_HOOK_API_URL }}







############################# .github/workflows/frontend.yml

name: Frontend CI

on:
  push:
    branches: [main]
    paths:
      - package.json
      - package-lock.json
      - ".github/**"
      - "workspaces/frontend/**"
  pull_request:
    branches: [main]
    paths:
      - package.json
      - package-lock.json
      - ".github/**"
      - "workspaces/frontend/**"

jobs:
  build:
    runs-on: ubuntu-latest

    strategy:
      matrix:
        node-version: [16.x, 18.x, 20.x]

    steps:
      - uses: actions/checkout@v3

      - name: Use Node.js ${{ matrix.node-version }}
        uses: actions/setup-node@v3
        with:
          node-version: ${{ matrix.node-version }}

      - name: install dependencies
        run: npm ci --workspace frontend --no-audit --no-fund --quiet --include-workspace-root

      - name: run tests
        run: npm run frontend:test