Skip to content

fix: check if event is base64 #25

fix: check if event is base64

fix: check if event is base64 #25

Workflow file for this run

---
name: AWS Build & Deployment
on:
workflow_run:
workflows: ["Versioning"]
types: [requested]
push:
branches:
- fix/aws-ci
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: us-east-1
AWS_S3_BUCKET: das.singularitynet.io
AWS_S3_BUCKET_KEY: production
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Install function requirements
run: |-
pip3 install awscli
for dir in */; do
if [[ $dir != .* ]]; then
cd $dir; pip3 install -r ./requirements.txt -t .; cd ..
fi
done
- name: Download DocumentDB pem
run: |-
for dir in */; do
if [[ $dir != .* ]]; then
cd $dir; wget https://truststore.pki.rds.amazonaws.com/global/global-bundle.pem; cd ..
fi
done
- name: Bundle function into a ZIP file
run: |-
for dir in */; do
if [[ $dir != .* ]]; then
FUNC_NAME=$(basename "$dir")
cd $dir; zip -r $FUNC_NAME.zip .; cd ..
fi
done
- name: Push function to s3
run: |-
for dir in */; do
if [[ $dir != .* ]]; then
FUNC_NAME=$(basename "$dir")
cd $dir; aws s3 cp ./$FUNC_NAME.zip s3://${{ env.AWS_S3_BUCKET }}/${{ env.AWS_S3_BUCKET_KEY }}/$FUNC_NAME.zip; cd ..
fi
done
deploy:
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Update lambda function
run: |-
for dir in */; do
if [[ $dir != .* ]]; then
FUNC_NAME=$(basename "$dir")
cd $dir; aws lambda update-function-code --function-name $FUNC_NAME --s3-bucket ${{ env.AWS_S3_BUCKET }} --s3-key ${{ env.AWS_S3_BUCKET_KEY }}/$FUNC_NAME.zip --publish --region ${{ env.AWS_REGION }}; cd ..
fi
done