-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e24d359
commit fa782bb
Showing
2 changed files
with
41 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: Deploy Azure Function App | ||
|
||
on: | ||
push: | ||
branches: | ||
- main # Trigger deployment on push to the main branch | ||
workflow_dispatch: # Allow manual trigger from the Actions tab | ||
|
||
jobs: | ||
build-and-deploy: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.9' # Specify the Python version | ||
|
||
- name: Create virtual environment | ||
run: python3 -m venv .azure_function_fastapi_venv | ||
|
||
- name: Activate virtual environment and install dependencies | ||
run: | | ||
source .azure_function_fastapi_venv/bin/activate | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.txt | ||
- name: Azure Login | ||
uses: azure/login@v1 | ||
with: | ||
creds: ${{ secrets.AZURE_CREDENTIALS }} | ||
|
||
- name: Deploy to Azure Function App | ||
uses: azure/functions-action@v1 | ||
with: | ||
app-name: ${{ secrets.PROJECT_NAME }} # Replace with your Function App name | ||
package: '.' # Specify the directory to deploy, usually the current directory |
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