ci: disable build job in pipeline #11
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI/CD Pipeline | |
| on: | |
| push: | |
| branches: [ main, develop ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| lint-and-type-check: | |
| name: Lint and Type Check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v2 | |
| with: | |
| version: 8 | |
| - name: Get pnpm store directory | |
| id: pnpm-cache | |
| shell: bash | |
| run: | | |
| echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT | |
| - name: Setup pnpm cache | |
| uses: actions/cache@v3 | |
| with: | |
| path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} | |
| key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pnpm-store- | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Run ESLint | |
| run: pnpm lint || true | |
| continue-on-error: true | |
| - name: Type check | |
| run: pnpm tsc --noEmit || true | |
| continue-on-error: true | |
| # build: | |
| # name: Build Application | |
| # runs-on: ubuntu-latest | |
| # needs: lint-and-type-check | |
| # continue-on-error: true | |
| # | |
| # steps: | |
| # - name: Checkout code | |
| # uses: actions/checkout@v4 | |
| # | |
| # - name: Setup Node.js | |
| # uses: actions/setup-node@v4 | |
| # with: | |
| # node-version: '20' | |
| # | |
| # - name: Setup pnpm | |
| # uses: pnpm/action-setup@v2 | |
| # with: | |
| # version: 8 | |
| # | |
| # - name: Install dependencies | |
| # run: pnpm install --frozen-lockfile | |
| # | |
| # - name: Create .env.local for build | |
| # run: | | |
| # cat > .env.local << EOL | |
| # MONGODB_URI=mongodb://localhost:27017/dewatt | |
| # DB_NAME=dewatt | |
| # SOLANA_RPC_URL=https://api.devnet.solana.com | |
| # NODE_ENV=production | |
| # NEXT_PUBLIC_API_URL=http://localhost:3000 | |
| # EOL | |
| # | |
| # - name: Build application | |
| # run: pnpm build | |
| # continue-on-error: true | |
| # | |
| # - name: Upload build artifacts | |
| # uses: actions/upload-artifact@v3 | |
| # if: success() | |
| # with: | |
| # name: build | |
| # path: .next | |
| # retention-days: 7 | |
| security-scan: | |
| name: Security Scan | |
| runs-on: ubuntu-latest | |
| continue-on-error: true | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Run Trivy vulnerability scanner | |
| uses: aquasecurity/trivy-action@master | |
| continue-on-error: true | |
| with: | |
| scan-type: 'fs' | |
| scan-ref: '.' | |
| format: 'sarif' | |
| output: 'trivy-results.sarif' | |
| severity: 'CRITICAL,HIGH' | |
| - name: Upload Trivy results to GitHub Security | |
| uses: github/codeql-action/upload-sarif@v2 | |
| if: always() | |
| continue-on-error: true | |
| with: | |
| sarif_file: 'trivy-results.sarif' |