Skip to content

Merge pull request #12 from nalbam/main #33

Merge pull request #12 from nalbam/main

Merge pull request #12 from nalbam/main #33

Workflow file for this run

name: Deploy to AWS Lambda
on:
push:
branches:
- main
env:
ALLOWED_CHANNEL_IDS: ${{ vars.ALLOWED_CHANNEL_IDS }}
BOT_CURSOR: ${{ vars.BOT_CURSOR }}
DYNAMODB_TABLE_NAME: ${{ vars.DYNAMODB_TABLE_NAME }}
ENABLE_IMAGE: ${{ vars.ENABLE_IMAGE }}
MODEL_ID_IMAGE: ${{ vars.MODEL_ID_IMAGE }}
SYSTEM_MESSAGE: ${{ vars.SYSTEM_MESSAGE }}
MODEL_ID_TEXT: ${{ vars.MODEL_ID_TEXT }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
SLACK_SIGNING_SECRET: ${{ secrets.SLACK_SIGNING_SECRET }}
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 "ALLOWED_CHANNEL_IDS=${ALLOWED_CHANNEL_IDS}" >> .env
echo "BOT_CURSOR=${BOT_CURSOR}" >> .env
echo "DYNAMODB_TABLE_NAME=${DYNAMODB_TABLE_NAME}" >> .env
echo "ENABLE_IMAGE=${ENABLE_IMAGE}" >> .env
echo "MODEL_ID_IMAGE=${MODEL_ID_IMAGE}" >> .env
echo "SLACK_BOT_TOKEN=${SLACK_BOT_TOKEN}" >> .env
echo "SLACK_SIGNING_SECRET=${SLACK_SIGNING_SECRET}" >> .env
echo "SYSTEM_MESSAGE=${SYSTEM_MESSAGE}" >> .env
echo "MODEL_ID_TEXT=${MODEL_ID_TEXT}" >> .env
- name: Deploy to AWS Lambda 🚀
run: npx serverless deploy --region us-east-1