Skip to content

Commit a267c8d

Browse files
committed
Update CI/CD workflows to use latest Bun version, replace tj-actions with dorny/paths-filter for changed file checks, and adjust conditionals for infrastructure and web changes. Upgrade Pulumi action version in preview workflow.
1 parent 5ceb968 commit a267c8d

File tree

3 files changed

+19
-25
lines changed

3 files changed

+19
-25
lines changed

.github/workflows/deploy.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- name: Setup Bun
2020
uses: oven-sh/setup-bun@v2
2121
with:
22-
bun-version: 1.2.8
22+
bun-version: latest
2323

2424
- name: Configure AWS credentials
2525
uses: aws-actions/configure-aws-credentials@v4
@@ -28,16 +28,16 @@ jobs:
2828
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
2929
aws-region: ${{ env.AWS_REGION }}
3030

31-
# Check what changed
31+
# Check what changed - Using dorny/paths-filter instead of compromised tj-actions
3232
- name: Check changed files
3333
id: changed-files
34-
uses: tj-actions/changed-files@v44
34+
uses: dorny/paths-filter@v3
3535
with:
36-
files_yaml: |
36+
filters: |
3737
infra:
38-
- apps/infra/**
38+
- 'apps/infra/**'
3939
web:
40-
- apps/web/**
40+
- 'apps/web/**'
4141
4242
# Login to ECR (needed for both paths)
4343
- name: Login to Amazon ECR
@@ -46,7 +46,7 @@ jobs:
4646

4747
# Path 1: Infrastructure changes - let Pulumi handle everything
4848
- name: Deploy infrastructure with Pulumi
49-
if: steps.changed-files.outputs.infra_any_changed == 'true'
49+
if: steps.changed-files.outputs.infra == 'true'
5050
run: |
5151
cd apps/infra
5252
bun install
@@ -55,7 +55,7 @@ jobs:
5555
5656
# Path 2: Code-only changes - build image and update ECS directly
5757
- name: Build and push Docker image
58-
if: steps.changed-files.outputs.infra_any_changed != 'true' && steps.changed-files.outputs.web_any_changed == 'true'
58+
if: steps.changed-files.outputs.infra != 'true' && steps.changed-files.outputs.web == 'true'
5959
working-directory: ./apps/web
6060
env:
6161
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
@@ -102,7 +102,7 @@ jobs:
102102
103103
# Update ECS service (only if we built a new image)
104104
- name: Update ECS service
105-
if: steps.changed-files.outputs.infra_any_changed != 'true' && steps.changed-files.outputs.web_any_changed == 'true'
105+
if: steps.changed-files.outputs.infra != 'true' && steps.changed-files.outputs.web == 'true'
106106
run: |
107107
aws ecs update-service \
108108
--cluster pathfinder-cluster \
@@ -116,4 +116,4 @@ jobs:
116116
- name: Deployment complete
117117
run: |
118118
echo "✅ Deployment completed successfully!"
119-
echo "🎯 Deployment type: ${{ steps.changed-files.outputs.infra_any_changed == 'true' && 'Infrastructure + App' || 'App Only' }}"
119+
echo "🎯 Deployment type: ${{ steps.changed-files.outputs.infra == 'true' && 'Infrastructure + App' || 'App Only' }}"

.github/workflows/preview.yml

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,7 @@ jobs:
1818
- name: Setup Bun
1919
uses: oven-sh/setup-bun@v2
2020
with:
21-
bun-version: 1.2.8
22-
23-
- name: Setup Node.js (for Pulumi)
24-
uses: actions/setup-node@v4
25-
with:
26-
node-version: "20"
27-
28-
- name: Install pnpm
29-
run: npm install -g pnpm
21+
bun-version: latest
3022

3123
- name: Configure AWS credentials
3224
uses: aws-actions/configure-aws-credentials@v4
@@ -37,11 +29,11 @@ jobs:
3729

3830
- name: Install dependencies
3931
run: |
32+
cd apps/infra
4033
bun install
41-
cd apps/infra && pnpm install
4234
4335
- name: Pulumi Preview
44-
uses: pulumi/actions@v5
36+
uses: pulumi/actions@v6
4537
with:
4638
command: preview
4739
stack-name: compai/placeholder-dev

apps/web/src/app/api/todos/[id]/route.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@ import { NextResponse } from "next/server";
55
// PATCH /api/todos/[id] - Update a todo
66
export async function PATCH(
77
request: Request,
8-
{ params }: { params: { id: string } }
8+
{ params }: { params: Promise<{ id: string }> }
99
) {
1010
try {
11-
const id = parseInt(params.id);
11+
const { id: idParam } = await params;
12+
const id = parseInt(idParam);
1213
if (isNaN(id)) {
1314
return NextResponse.json({ error: "Invalid todo ID" }, { status: 400 });
1415
}
@@ -53,10 +54,11 @@ export async function PATCH(
5354
// DELETE /api/todos/[id] - Delete a todo
5455
export async function DELETE(
5556
request: Request,
56-
{ params }: { params: { id: string } }
57+
{ params }: { params: Promise<{ id: string }> }
5758
) {
5859
try {
59-
const id = parseInt(params.id);
60+
const { id: idParam } = await params;
61+
const id = parseInt(idParam);
6062
if (isNaN(id)) {
6163
return NextResponse.json({ error: "Invalid todo ID" }, { status: 400 });
6264
}

0 commit comments

Comments
 (0)