Skip to content

Merge pull request #5 from nalbam/main #26

Merge pull request #5 from nalbam/main

Merge pull request #5 from nalbam/main #26

Workflow file for this run

name: Deploy to AWS Lambda
on:
push:
branches:
- main
env:
BOT_CURSOR: ${{ secrets.BOT_CURSOR }}
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
SLACK_SIGNING_SECRET: ${{ secrets.SLACK_SIGNING_SECRET }}
DYNAMODB_TABLE_NAME: ${{ secrets.DYNAMODB_TABLE_NAME }}
TEXT_MODEL_ID: ${{ secrets.TEXT_MODEL_ID }}
IMAGE_MODEL_ID: ${{ secrets.IMAGE_MODEL_ID }}
SYSTEM_MESSAGE: ${{ vars.SYSTEM_MESSAGE }}
ALLOWED_CHANNEL_IDS: ${{ secrets.ALLOWED_CHANNEL_IDS }}
ENABLE_IMAGE: ${{ secrets.ENABLE_IMAGE }}
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Python 3.9 🐍
uses: actions/setup-python@v5
with:
python-version: '3.9'
- name: Install dependencies
run: npm install
- name: Install Python dependencies
run: npx serverless plugin install --name serverless-python-requirements
- name: Install dotenv plugin
run: npx serverless plugin install --name serverless-dotenv-plugin
- name: Install dependencies
run: pip install -r requirements.txt
- name: Set up environment variables 📝
run: |
echo "BOT_CURSOR=${BOT_CURSOR}" >> .env
echo "SLACK_BOT_TOKEN=${SLACK_BOT_TOKEN}" >> .env
echo "SLACK_SIGNING_SECRET=${SLACK_SIGNING_SECRET}" >> .env
echo "DYNAMODB_TABLE_NAME=${DYNAMODB_TABLE_NAME}" >> .env
echo "TEXT_MODEL_ID=${TEXT_MODEL_ID}" >> .env
echo "IMAGE_MODEL_ID=${IMAGE_MODEL_ID}" >> .env
echo "SYSTEM_MESSAGE=${SYSTEM_MESSAGE}" >> .env
echo "ALLOWED_CHANNEL_IDS=${ALLOWED_CHANNEL_IDS}" >> .env
echo "ENABLE_IMAGE=${ENABLE_IMAGE}" >> .env
- name: Deploy to AWS Lambda 🚀
env:
AWS_REGION: 'us-east-1'
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: npx serverless deploy