diff --git a/.github/workflows/deploy_fastapi_backend.yml b/.github/workflows/deploy_fastapi_backend.yml new file mode 100644 index 00000000..bc5e4baa --- /dev/null +++ b/.github/workflows/deploy_fastapi_backend.yml @@ -0,0 +1,36 @@ +name: Serverless Deploy + +on: + push: + branches: [ dev, prod ] + +jobs: + deploy: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.10 + + - name: Install Serverless + run: npm install -g serverless + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements/base.txt + + - name: AWS credentials + uses: aws-actions/configure-aws-credentials@v1 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: eu-west-2 + + - name: Deploy to AWS Lambda via Serverless + run: sls deploy --stage ${{ github.ref_name }}