From e02413130f65e9d8a2c762cfd8ae11f3dca0568d Mon Sep 17 00:00:00 2001 From: Nathan Probert Date: Fri, 28 Aug 2026 23:59:44 -0400 Subject: [PATCH 1/3] Cache uv deps in deploy job and use uv pip install --- .github/workflows/deploy.yml | 8 ++++++++ build_scripts/deploy.sh | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 0d15a3f..19ffb87 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -175,6 +175,14 @@ jobs: - name: Install uv uses: astral-sh/setup-uv@v5 + - name: Cache uv + uses: actions/cache@v4 + with: + path: ~/.cache/uv + key: uv-${{ runner.os }}-${{ hashFiles('uv.lock') }} + restore-keys: | + uv-${{ runner.os }}- + - name: Install dependencies run: uv sync --no-dev diff --git a/build_scripts/deploy.sh b/build_scripts/deploy.sh index 14d7ce7..9307fe0 100755 --- a/build_scripts/deploy.sh +++ b/build_scripts/deploy.sh @@ -273,7 +273,7 @@ if [ $? -ne 0 ]; then echo "Error: Dependency export failed." exit 1 fi -uv run pip install --no-deps -r $OUTPUT_DIR/requirements.txt -t $OUTPUT_DIR +uv pip install --no-deps -r $OUTPUT_DIR/requirements.txt -t $OUTPUT_DIR if [ $? -ne 0 ]; then echo "Error: Dependency install failed." exit 1 From 2655120fcd8f6273ac364efc0ad1e15509454804 Mon Sep 17 00:00:00 2001 From: Nathan Probert Date: Sat, 29 Aug 2026 00:09:54 -0400 Subject: [PATCH 2/3] Fix Cache uv path to match setup-uv UV_CACHE_DIR --- .github/workflows/deploy.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 19ffb87..3e8c385 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -34,7 +34,7 @@ jobs: - name: Cache uv uses: actions/cache@v4 with: - path: ~/.cache/uv + path: ${{ runner.temp }}/setup-uv-cache key: uv-${{ runner.os }}-${{ hashFiles('uv.lock') }} restore-keys: | uv-${{ runner.os }}- @@ -98,7 +98,7 @@ jobs: - name: Cache uv uses: actions/cache@v4 with: - path: ~/.cache/uv + path: ${{ runner.temp }}/setup-uv-cache key: uv-${{ runner.os }}-${{ hashFiles('uv.lock') }} - name: Install dependencies @@ -126,7 +126,7 @@ jobs: - name: Cache uv uses: actions/cache@v4 with: - path: ~/.cache/uv + path: ${{ runner.temp }}/setup-uv-cache key: uv-${{ runner.os }}-${{ hashFiles('uv.lock') }} - name: Install dependencies @@ -178,7 +178,7 @@ jobs: - name: Cache uv uses: actions/cache@v4 with: - path: ~/.cache/uv + path: ${{ runner.temp }}/setup-uv-cache key: uv-${{ runner.os }}-${{ hashFiles('uv.lock') }} restore-keys: | uv-${{ runner.os }}- From df947a0f8954245038f8b900edb40e15b44aca44 Mon Sep 17 00:00:00 2001 From: Nathan Probert Date: Sat, 29 Aug 2026 00:16:45 -0400 Subject: [PATCH 3/3] Serialize concurrent deploys and surface AWS errors on Lambda update failure --- .github/workflows/deploy.yml | 6 ++++++ build_scripts/deploy.sh | 8 +++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 3e8c385..db367f5 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -7,6 +7,12 @@ on: pull_request: types: [opened, synchronize, reopened, labeled] +# Serialize runs per ref so two concurrent runs never deploy the same stack at +# once (AWS Lambda allows only one in-flight code update per function). +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: false + jobs: setup: runs-on: ubuntu-latest diff --git a/build_scripts/deploy.sh b/build_scripts/deploy.sh index 9307fe0..3323e25 100755 --- a/build_scripts/deploy.sh +++ b/build_scripts/deploy.sh @@ -172,13 +172,15 @@ update_lambda_code() { for FUNCTION in "${LAMBDA_FUNCTIONS[@]}"; do ( echo "Updating Lambda function code: $FUNCTION..." - if ! aws lambda update-function-code \ + if ERROR_OUTPUT=$(aws lambda update-function-code \ --function-name "$FUNCTION" \ - --zip-file fileb://$OUTPUT_DIR/$KEY &>/dev/null; then + --zip-file fileb://$OUTPUT_DIR/$KEY 2>&1); then + echo "Lambda function code updated successfully: $FUNCTION." + else echo "Error: Failed to update Lambda function code: $FUNCTION." + echo "$ERROR_OUTPUT" exit 1 fi - echo "Lambda function code updated successfully: $FUNCTION." ) & PIDS+=($!) UPDATE_COUNT=$((UPDATE_COUNT + 1))