Skip to content

Merge pull request #48 from dhrumilp12/dev #2

Merge pull request #48 from dhrumilp12/dev

Merge pull request #48 from dhrumilp12/dev #2

# name: Deploy Backend Container
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./server
steps:
- name: Checkout the Git Repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.11.9
- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
- name: Configure Poetry
run: |
echo "$HOME/.local/bin" >> $GITHUB_PATH
poetry config virtualenvs.create false
- name: Install dependencies with Poetry
run: |
poetry install
# - name: Log in to Azure CLI
# uses: azure/login@v2
# with:
# creds: ${{ secrets.AZURE_CREDENTIALS }}
# # Ensure AZURE_CREDENTIALS is set in your GitHub Secrets
# - name: Build and Push Docker image
# run: |
# docker build --pull --rm -t mental-health-app:latest .
# docker tag mental-health-app:latest dgmlgmckl6olsb4registry.azurecr.io/mental-health-app:1.0.0
# echo ${{ secrets.REGISTRY_PASSWORD }} | docker login dgmlgmckl6olsb4registry.azurecr.io -u ${{ secrets.REGISTRY_USERNAME }} --password-stdin
# docker push dgmlgmckl6olsb4registry.azurecr.io/mental-health-app:1.0.0
# # Use REGISTRY_USERNAME and REGISTRY_PASSWORD secrets for Docker registry credentials
# - name: Deploy to Azure Container Apps
# run: |
# az account set --subscription ${{ secrets.SUBSCRIPTION_ID }}
# az extension add --name containerapp --upgrade
# az containerapp env create --name mental-health-app-ctr-env-2 --resource-group mongo-devguide-rg --location "eastus"
# az containerapp up --name mental-health-app-ctr --image dgmlgmckl6olsb4registry.azurecr.io/mental-health-app:1.0.0 --resource-group mongo-devguide-rg --environment mental-health-app-ctr-env-2 --ingress external
# # Use SUBSCRIPTION_ID secret for Azure subscription ID