Created
February 1, 2026 04:42
-
-
Save m3h3d1ha2an/eb9619576493cd7e275beef2e463a3cf to your computer and use it in GitHub Desktop.
A good comprehensive production grade qurality check github action workflow for a nextjs frontend source code.
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: Quality Assurance | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: ["**"] | |
| paths-ignore: | |
| - "**.md" | |
| - ".gitignore" | |
| - ".env.example" | |
| pull_request: | |
| branches: ["**"] | |
| paths-ignore: | |
| - "**.md" | |
| - ".gitignore" | |
| - ".env.example" | |
| jobs: | |
| validate: | |
| name: "Task: ${{ matrix.command }}" | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| command: [check, typecheck, build] | |
| fail-fast: false | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v6 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| - name: Setup Node.js | |
| id: setup-node | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version-file: "package.json" | |
| cache: "pnpm" | |
| - name: Restore Next.js Build Cache | |
| if: ${{ matrix.command == 'build' }} | |
| uses: actions/cache@v5 | |
| with: | |
| path: .next/cache | |
| key: ${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }} | |
| restore-keys: | | |
| ${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml') }}- | |
| - name: Install Dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Run ${{ matrix.command }} | |
| run: pnpm run ${{ matrix.command }} | |
| env: | |
| BACKEND_URL: http://localhost:5000 | |
| NODE_ENV: test | |
| SKIP_ENV_VALIDATION: ${{ matrix.command == 'build' && '1' || '0' }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment