diff --git a/.github/workflows/seo.yml b/.github/workflows/code-quality.yml similarity index 78% rename from .github/workflows/seo.yml rename to .github/workflows/code-quality.yml index e9f7227..daccca1 100644 --- a/.github/workflows/seo.yml +++ b/.github/workflows/code-quality.yml @@ -1,9 +1,50 @@ -name: Quality & SEO Audit -on: [pull_request] +name: Code Quality & SEO Audit + +on: + push: + branches: ["main"] + pull_request: + branches: ["main"] jobs: - audit: + code-quality: + name: Code Quality + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: oven-sh/setup-bun@v2 + with: + bun-version: latest + + # Cache dependencies for faster builds + - uses: actions/cache@v4 + id: bun-cache + with: + path: ~/.bun/install/cache + key: ${{ runner.os }}-bun-${{ hashFiles('website/bun.lock') }} + restore-keys: | + ${{ runner.os }}-bun- + + - uses: actions/cache@v4 + id: node-modules-cache + with: + path: website/node_modules + key: ${{ runner.os }}-node-modules-${{ hashFiles('website/package.json') }} + restore-keys: | + ${{ runner.os }}-node-modules- + + - name: Install Dependencies & Run Code Quality + working-directory: website + run: | + bun install --frozen-lockfile + bun run format:check + + seo-audit: + name: SEO Audit runs-on: ubuntu-latest + # Only run if code-quality job succeeds + needs: code-quality steps: - uses: actions/checkout@v4 @@ -101,4 +142,4 @@ jobs: name: seo-report path: website/seo-report.zip if-no-files-found: warn # Warn instead of error if no files found - retention-days: 7 # Auto-delete after 7 days to save space + retention-days: 7 # Auto-delete after 7 days to save space \ No newline at end of file