Skip to content

Commit

Permalink
provide db url
Browse files Browse the repository at this point in the history
  • Loading branch information
rhyek committed Apr 1, 2024
1 parent 8fbce31 commit 3314a64
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -126,4 +126,6 @@ jobs:
run: |
echo "LAMBDA_ROLE_ARN=${{ needs.terraform.outputs.iam_lambda_role_arn }}" >> $GITHUB_ENV
- name: Deploy
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}
run: make deploy
8 changes: 6 additions & 2 deletions projects/update-ynab/scripts/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,17 @@ function_name="update-ynab-fn"
if aws lambda get-function --function-name $function_name --region us-east-1 &> /dev/null; then
echo "Updating function"
aws lambda update-function-code --function-name $function_name \
--zip-file fileb://$ZIPFILE
--environment "Variables={DATABASE_URL=$DATABASE_URL" \
--zip-file fileb://$ZIPFILE \
> /dev/null
else
echo "Creating function"
aws lambda create-function --function-name $function_name \
--runtime provided.al2023 \
--handler bootstrap \
--architectures arm64 \
--role $LAMBDA_ROLE_ARN \
--zip-file fileb://$ZIPFILE
--environment "Variables={DATABASE_URL=$DATABASE_URL" \
--zip-file fileb://$ZIPFILE \
> /dev/null
fi

0 comments on commit 3314a64

Please sign in to comment.