Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -34,7 +40,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 }}-
Expand Down Expand Up @@ -98,7 +104,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
Expand Down Expand Up @@ -126,7 +132,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
Expand Down Expand Up @@ -175,6 +181,14 @@ jobs:
- name: Install uv
uses: astral-sh/setup-uv@v5

- name: Cache uv
uses: actions/cache@v4
with:
path: ${{ runner.temp }}/setup-uv-cache
key: uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
restore-keys: |
uv-${{ runner.os }}-

- name: Install dependencies
run: uv sync --no-dev

Expand Down
10 changes: 6 additions & 4 deletions build_scripts/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -273,7 +275,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
Expand Down
Loading