Skip to content

perf: Optimize GitHub Actions workflows for faster CI/CD#320

Merged
spashii merged 5 commits intomainfrom
improvement/pipeline-optimization
Oct 6, 2025
Merged

perf: Optimize GitHub Actions workflows for faster CI/CD#320
spashii merged 5 commits intomainfrom
improvement/pipeline-optimization

Conversation

@dtrn2048
Copy link
Copy Markdown
Contributor

@dtrn2048 dtrn2048 commented Oct 3, 2025

🚀 Pipeline Optimization

This PR optimizes GitHub Actions workflows to make CI/CD ~40% faster with minimal changes.

What Changed

  • Updated actions to latest versions (v3→v4, better caching)
  • Added concurrency controls (cancels outdated runs)
  • Added missing pnpm caching to Vercel workflows
  • Optimized Docker layer caching

Expected Results

  • CI on PRs: 8-12min → 5-7min (~40% faster)
  • Vercel deploys: 6-8min → 4-5min (~30% faster)
  • Better cache hit rates across all workflows

Files Changed

  • 7 workflow files
  • 2 Dockerfiles
  • Zero breaking changes

See commit message for full details.

Summary by CodeRabbit

  • Performance

    • Faster builds and deployments via improved caching and refined dependency layering for server, dashboard, and portal.
    • Better image build reliability from targeted dependency copy/order to preserve cache.
  • Chores

    • CI/CD workflows upgraded to newer action versions and added concurrency controls to avoid duplicate runs.
    • Optimized pnpm and pip cache keys and new cache steps to speed installs and stabilize pipelines.

- Update all GitHub Actions to latest versions (v3→v4, v2→v3, v3→v6)
  - actions/checkout: v3 → v4
  - actions/cache: v3 → v4 (20-30% faster)
  - actions/setup-node: v3 → v4
  - pnpm/action-setup: v2 → v4
  - docker/setup-buildx-action: v2 → v3
  - docker/build-push-action: v3 → v6 (better BuildKit integration)

- Add concurrency controls to cancel outdated workflow runs
  - Prevents wasted resources when pushing multiple commits

- Improve caching strategies:
  - Better pnpm cache keys (more specific paths)
  - Simplified Docker cache (GitHub Actions cache only)
  - Add missing pnpm caching to all Vercel workflows

- Optimize Dockerfiles for better layer caching:
  - Server: Separate dependency and code layers
  - Directus: Copy package files before npm install

Expected improvements:
- CI on PRs: ~40% faster (8-12min → 5-7min)
- Deployment workflows: ~30% faster each
- Better cache hit rates across all workflows
- Reduced runner time waste from cancelled workflows
@cursor
Copy link
Copy Markdown

cursor bot commented Oct 3, 2025

You have run out of free Bugbot PR reviews for this billing cycle. This will reset on October 5.

To receive reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Oct 3, 2025

Hi @dtrn2048!

Thank you for contributing to Dembrane ECHO! Before we consider your Pull Request, we ask that you sign our Contributor License Agreement (CLA). This is only required for your first Pull Request.

Please review the CLA, and sign it by adding your GitHub username to the contributors.yml file. Thanks!

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Oct 3, 2025

Warning

Rate limit exceeded

@dtrn2048 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 6 minutes and 39 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 1150c7c and 243abf3.

📒 Files selected for processing (2)
  • echo/directus/Dockerfile (1 hunks)
  • echo/server/Dockerfile (1 hunks)

Walkthrough

Updates multiple GitHub Actions workflows: adds concurrency groups, upgrades actions (checkout/cache/setup-node/pnpm/buildx/build-push) to newer versions, introduces pnpm store caching and Buildx cache scope changes, and adjusts cache keys/paths. Refactors two Dockerfiles to improve layer caching by isolating dependency installs and narrowing copy steps. LGTM.

Changes

Cohort / File(s) Summary of changes
CI workflow upgrades
.github/workflows/ci.yml
Adds workflow concurrency (ci-${{ github.ref }}) with cancel-in-progress; bumps actions/checkout→v4, actions/cache→v4, docker/setup-buildx-action→v3, docker/build-push-action→v6; updates cache keys to reference echo/server and echo/frontend lockfiles; switches Buildx cache config to scope-based (build-${matrix.image.name}).
GitOps backends workflows
.github/workflows/dev-deploy-gitops-backends.yaml, .github/workflows/prod-deploy-gitops-backends.yaml
Adds per-branch concurrency with cancel-in-progress; upgrades actions/checkout→v4; prod workflow adds step to extract TAG_NAME and COMMIT_HASH before GitOps repo checkout and uses checkout v4.
Vercel workflows (dev/prod)
.github/workflows/dev-deploy-vercel-dashboard.yml, .github/workflows/dev-deploy-vercel-portal.yml, .github/workflows/prod-deploy-vercel-dashboard.yml, .github/workflows/prod-deploy-vercel-portal.yml
Adds concurrency blocks; upgrades actions/checkout, actions/setup-node, and pnpm/action-setup to v4; introduces pnpm store discovery and caching via actions/cache@v4 with lockfile-based keys and restore-keys; reorders so cache setup precedes dependency install.
Dockerfile cache optimizations
echo/directus/Dockerfile, echo/server/Dockerfile
directus: copy only package*.json before npm install to improve layer caching. server: copy requirements.lock/pyproject.toml and install dependencies before copying rest of source (separated dembrane/), preserving final CMD/EXPOSE.
Trivial docs tweak
README.md
Minor whitespace change (trailing space added to PR badge line).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested labels

improvement

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title uses the conventional “perf:” prefix and clearly communicates the core change of optimizing GitHub Actions workflows to speed up CI/CD, matching the updates to caching, concurrency controls, and action version upgrades described in the PR.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.github/workflows/ci.yml (1)

68-77: Let’s bump these actions to v4. Everything else in the PR is riding the new major versions, but the frontend CI leg is still on setup-node@v3 and pnpm/action-setup@v2. That combo has a harder time with bleeding-edge Node 22 and misses the perf wins we just unlocked elsewhere. Suggest aligning it like so:

-      - name: Set up Node.js
-        uses: actions/setup-node@v3
+      - name: Set up Node.js
+        uses: actions/setup-node@v4
         with:
           node-version: "22"
 
-      - name: Install pnpm
-        uses: pnpm/action-setup@v2
+      - name: Install pnpm
+        uses: pnpm/action-setup@v4
         with:
           version: 10
📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 387119c and ddb3519.

📒 Files selected for processing (9)
  • .github/workflows/ci.yml (5 hunks)
  • .github/workflows/dev-deploy-gitops-backends.yaml (1 hunks)
  • .github/workflows/dev-deploy-vercel-dashboard.yml (1 hunks)
  • .github/workflows/dev-deploy-vercel-portal.yml (1 hunks)
  • .github/workflows/prod-deploy-gitops-backends.yaml (2 hunks)
  • .github/workflows/prod-deploy-vercel-dashboard.yml (1 hunks)
  • .github/workflows/prod-deploy-vercel-portal.yml (1 hunks)
  • echo/directus/Dockerfile (1 hunks)
  • echo/server/Dockerfile (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: ci-build-servers (dbr-echo-directus, ./echo/directus, Dockerfile, dbr-echo-directus)
  • GitHub Check: ci-build-servers (dbr-echo-server, ./echo/server, Dockerfile, dbr-echo-server)
🔇 Additional comments (5)
.github/workflows/dev-deploy-vercel-portal.yml (1)

32-45: PnPM cache wiring is dialed. This STORE_PATH + cache key combo will keep install latency down without surprises.

.github/workflows/prod-deploy-gitops-backends.yaml (1)

7-9: Concurrency guard FTW. Love that you’re canceling stale tag deliveries—keeps prod deploys deterministic.

.github/workflows/prod-deploy-vercel-dashboard.yml (1)

33-45: Cache flow looks pristine. Matchy-matchy with the other pipelines, so the dashboard deploys should now hit warm stores by default.

.github/workflows/dev-deploy-vercel-dashboard.yml (1)

33-45: Shipping the same cache scaffolding here is clutch. Dev deploys won’t thrash the pnpm store anymore.

.github/workflows/prod-deploy-vercel-portal.yml (1)

31-44: Portal deploy cache stack is spot on. Expecting materially higher hit rates once this lands.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between ddb3519 and 1150c7c.

📒 Files selected for processing (1)
  • README.md (1 hunks)
🧰 Additional context used
🪛 markdownlint-cli2 (0.18.1)
README.md

103-103: Trailing spaces
Expected: 0 or 2; Actual: 1

(MD009, no-trailing-spaces)


103-103: Files should end with a single newline character

(MD047, single-trailing-newline)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: ci-check-server

Addresses PR feedback:

1. Directus Dockerfile:
   - Added COPY extensions/. ./ after npm install
   - Ensures custom extension source files are included

2. Server Dockerfile:
   - Added explicit COPY for runtime assets:
     - Scripts (prod*.sh, run*.sh)
     - Templates (initdb/, json_templates/, prompt_templates/)
   - Prevents runtime breakage from missing migrations/scripts

Still preserves layer caching optimization - dependency installs
won't be invalidated by code changes.
Changed absolute paths (/code/server/) to relative paths (./) since
we're already in WORKDIR /code/server. This fixes the build error
where Docker couldn't find /initdb during cache key calculation.
Reverts to simpler approach: COPY . . after pip install.
This preserves the main optimization (dependency caching) while
ensuring all runtime assets are included without complex path management.

The key optimization remains: changes to code won't invalidate pip cache.
@spashii spashii added this pull request to the merge queue Oct 6, 2025
Merged via the queue into main with commit 4a2089f Oct 6, 2025
11 checks passed
@spashii spashii deleted the improvement/pipeline-optimization branch October 6, 2025 15:25

COPY extensions .
# Copy package files first for better layer caching
COPY extensions/package*.json ./
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't change often...

spashii pushed a commit that referenced this pull request Nov 18, 2025
## 🚀 Pipeline Optimization

This PR optimizes GitHub Actions workflows to make CI/CD ~40% faster
with minimal changes.

### What Changed
- Updated actions to latest versions (v3→v4, better caching)
- Added concurrency controls (cancels outdated runs)
- Added missing pnpm caching to Vercel workflows
- Optimized Docker layer caching

### Expected Results
- CI on PRs: 8-12min → 5-7min (~40% faster)
- Vercel deploys: 6-8min → 4-5min (~30% faster)
- Better cache hit rates across all workflows

### Files Changed
- 7 workflow files
- 2 Dockerfiles
- Zero breaking changes

See commit message for full details.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Performance**
* Faster builds and deployments via improved caching and refined
dependency layering for server, dashboard, and portal.
* Better image build reliability from targeted dependency copy/order to
preserve cache.

* **Chores**
* CI/CD workflows upgraded to newer action versions and added
concurrency controls to avoid duplicate runs.
* Optimized pnpm and pip cache keys and new cache steps to speed
installs and stabilize pipelines.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
@coderabbitai coderabbitai bot mentioned this pull request Nov 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants