Added concurrency groups to both CI and Deploy workflows to: - Queue jobs per workflow and branch combination - Cancel older runs when new commits are pushed - Prevent resource conflicts on self-hosted runners 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
49 lines
No EOL
1.3 KiB
YAML
49 lines
No EOL
1.3 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [ main, master, feature/* ]
|
|
pull_request:
|
|
branches: [ main, master ]
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: self-hosted
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Cache dependencies
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: ~/.npm
|
|
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-node-
|
|
|
|
- name: Cache Next.js build
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: ${{ github.workspace }}/.next/cache
|
|
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/*.[jt]s', '**/*.[jt]sx') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Run linting
|
|
run: npm run lint
|
|
|
|
- name: Run type checking
|
|
run: npm run typecheck
|
|
|
|
- name: Build application
|
|
run: npm run build
|
|
env:
|
|
# Use empty string for YOUTUBE_API_KEY during CI build
|
|
YOUTUBE_API_KEY: "" |