Skip to content

Commit

Permalink
github action
Browse files Browse the repository at this point in the history
  • Loading branch information
mostafa6765 committed May 25, 2024
1 parent 3c77aeb commit 01f631d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
24 changes: 11 additions & 13 deletions .github/workflows/sls.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Deploy master branch
name: 🚀 Deploy Serverless (fastapi)

on:
push:
Expand All @@ -12,33 +12,31 @@ jobs:
name: Deploy
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.20.3]

steps:
- uses: actions/checkout@v3
- name: 📥 Checkout code
uses: actions/checkout@v3

- name: Set up Node.js ${{ matrix.node-version }}
- name: 🛠️ Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
node-version: 18.20.3

- name: Set up Python 3.9
- name: 🐍 Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: '3.9'

- name: Install Serverless Framework v3.38.0 globally
- name: 📦 Install Serverless Framework v3.38.0 globally
run: npm install -g [email protected]

- name: Install serverless-python-requirements globally
- name: 🧩 Install serverless-python-requirements globally
run: serverless plugin install --name serverless-python-requirements

- run: npm ci
- name: 📦 Install Node.js dependencies
run: npm ci

# Ensure Serverless plugin for Python requirements is installed and deploy
- name: Serverless deploy
- name: 🚀 Serverless deploy
run: serverless deploy
env:
# To link with your Serverless Framework account, equivalent to login
Expand Down
2 changes: 1 addition & 1 deletion fastapi_project/api/root_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
@router.get("/")
async def root_index(request: Request):
data = {
'message': 'aws lamda function is running...'
'message': 'aws lamda function is running....'
}
return JSONResponse(content=data, status_code=status.HTTP_200_OK)

0 comments on commit 01f631d

Please sign in to comment.