Merge pull request #33 from nalbam/main #53
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: Deploy to AWS Lambda | |
on: | |
push: | |
branches: | |
- main | |
repository_dispatch: | |
types: | |
- deploy | |
env: | |
AGENT_ALIAS_ID: ${{ vars.AGENT_ALIAS_ID }} | |
AGENT_ID: ${{ vars.AGENT_ID }} | |
ALLOWED_CHANNEL_IDS: ${{ vars.ALLOWED_CHANNEL_IDS }} | |
BOT_CURSOR: ${{ vars.BOT_CURSOR }} | |
DYNAMODB_TABLE_NAME: ${{ vars.DYNAMODB_TABLE_NAME }} | |
MAX_LEN_SLACK: ${{ vars.MAX_LEN_SLACK }} | |
PERSONAL_MESSAGE: ${{ vars.PERSONAL_MESSAGE }} | |
SLACK_SAY_INTERVAL: ${{ vars.SLACK_SAY_INTERVAL }} | |
SYSTEM_MESSAGE: ${{ vars.SYSTEM_MESSAGE }} | |
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 "AGENT_ALIAS_ID=${AGENT_ALIAS_ID}" >> .env | |
echo "AGENT_ID=${AGENT_ID}" >> .env | |
echo "ALLOWED_CHANNEL_IDS=${ALLOWED_CHANNEL_IDS}" >> .env | |
echo "BOT_CURSOR=${BOT_CURSOR}" >> .env | |
echo "DYNAMODB_TABLE_NAME=${DYNAMODB_TABLE_NAME}" >> .env | |
echo "MAX_LEN_SLACK=${MAX_LEN_SLACK}" >> .env | |
echo "PERSONAL_MESSAGE=${PERSONAL_MESSAGE}" >> .env | |
echo "SLACK_BOT_TOKEN=${SLACK_BOT_TOKEN}" >> .env | |
echo "SLACK_SAY_INTERVAL=${SLACK_SAY_INTERVAL}" >> .env | |
echo "SLACK_SIGNING_SECRET=${SLACK_SIGNING_SECRET}" >> .env | |
echo "SYSTEM_MESSAGE=${SYSTEM_MESSAGE}" >> .env | |
- name: Deploy to AWS Lambda 🚀 | |
run: npx serverless deploy --region us-east-1 |