Skip to content

perf: only deploy projects with changed files#42

Merged
nirokato merged 1 commit into
mainfrom
fix/deploy-only-changed-projects
Apr 2, 2026
Merged

perf: only deploy projects with changed files#42
nirokato merged 1 commit into
mainfrom
fix/deploy-only-changed-projects

Conversation

@nirokato
Copy link
Copy Markdown
Owner

@nirokato nirokato commented Apr 2, 2026

Instead of deploying all projects on every push, diff the push to find which projects/ directories changed and only deploy those.

  • git diff between before/after SHAs to find changed files
  • Extract unique project names from paths
  • Empty matrix = no deploy jobs spawned
  • Falls back to deploying all on first push or force push

Uses git diff to detect which projects/ directories changed in the push.
Only those projects get deployed. If no project files changed (e.g. only
tofu or docs), the deploy job is skipped entirely.
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 2, 2026

OpenTofu Plan

Plan output
data.cloudflare_zone.zone: Reading...
cloudflare_pages_project.project["peer-drop"]: Refreshing state... [id=andy-apps-peer-drop]
cloudflare_pages_project.project["clock"]: Refreshing state... [id=andy-apps-clock]
cloudflare_pages_project.project["homepage"]: Refreshing state... [id=andy-apps-homepage]
cloudflare_pages_project.preview: Refreshing state... [id=andy-apps-preview]
cloudflare_pages_project.project["weft"]: Refreshing state... [id=andy-apps-weft]
data.cloudflare_zone.zone: Read complete after 1s [id=a7f7a62f2c2b914baa9b82b9e41a29c5]
cloudflare_pages_domain.domain["clock"]: Refreshing state... [id=74b72e0f-818d-420e-859a-f0437bd35828]
cloudflare_pages_domain.domain["peer-drop"]: Refreshing state... [id=69db182b-cd41-43ba-8c0c-bcfc92d974e9]
cloudflare_pages_domain.domain["homepage"]: Refreshing state... [id=2c55d7af-683f-4463-aa98-5bc7b1e707cd]
cloudflare_record.cname["homepage"]: Refreshing state... [id=c2155ce7863f7e7689dc3f05367746e2]
cloudflare_pages_domain.domain["weft"]: Refreshing state... [id=df0069d6-a9c4-411d-b52b-88227318b108]
cloudflare_record.cname["clock"]: Refreshing state... [id=d0e16b835decb7bb06f5feb0736801e3]
cloudflare_record.cname["peer-drop"]: Refreshing state... [id=569777844ae8c626fc232d14b0837470]
cloudflare_record.cname["weft"]: Refreshing state... [id=e2411dbb4de2318f0f00d1d47b584e4d]

No changes. Your infrastructure matches the configuration.

OpenTofu has compared your real infrastructure against your configuration and
found no differences, so no changes are needed.

@nirokato nirokato merged commit 29f4801 into main Apr 2, 2026
3 checks passed
@nirokato nirokato deleted the fix/deploy-only-changed-projects branch April 6, 2026 23:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant