Refactor getByDeviceId function in OceanData class to return raw items #140
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Zip and Update Lambda Function | |
on: | |
push: | |
branches: [main] | |
env: | |
AWS_REGION: "us-east-1" | |
S3_BUCKET: "wavewise" | |
LAMBDA_FUNCTION_NAME: "wavewise-backend" | |
jobs: | |
deploy: | |
name: Deploy to S3 and Update Lambda Function | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
contents: read | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Configure AWS credentials from IAM role | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
role-to-assume: arn:aws:iam::851725484938:role/github-aws | |
aws-region: ${{ env.AWS_REGION }} | |
role-session-name: GitHubActionsDeploymentSession | |
- name: Install Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "16" | |
- name: Install production dependencies with Yarn | |
run: yarn install --frozen-lockfile --production | |
- name: Zip project directory excluding development files | |
run: zip -r wavewise-backend.zip . -x "*.git*" -x "*tests*" | |
- name: Upload zip to S3 | |
run: aws s3 cp wavewise-backend.zip s3://${{ env.S3_BUCKET }}/${{ env.LAMBDA_FUNCTION_NAME }}.zip | |
- name: Update Lambda function code from S3 | |
run: | | |
aws lambda update-function-code \ | |
--function-name ${{ env.LAMBDA_FUNCTION_NAME }} \ | |
--s3-bucket ${{ env.S3_BUCKET }} \ | |
--s3-key ${{ env.LAMBDA_FUNCTION_NAME }}.zip |