-
Notifications
You must be signed in to change notification settings - Fork 3
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
Showing
21 changed files
with
237 additions
and
63 deletions.
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,57 @@ | ||
# 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 |
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,62 @@ | ||
name: Build and deploy Node.js app to Azure Web App - mental-health-app-web | ||
|
||
# Run the workflow on pushes to main branch | ||
on: | ||
push: | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: 'production' | ||
defaults: | ||
run: | ||
working-directory: ./client/ | ||
|
||
steps: | ||
- name: Checkout Git repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Node.js version | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '20.x' | ||
|
||
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Build distribution files | ||
run: npm run build | ||
env: | ||
VITE_AXIOS_BASE_URL: ${{ vars.VITE_AXIOS_BASE_URL }} | ||
|
||
- name: Upload artifact for deploment job | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: node-app | ||
path: ./client/dist/ | ||
|
||
deploy: | ||
runs-on: ubuntu-latest | ||
needs: build | ||
environment: | ||
name: 'production' | ||
url: ${{ vars.WEB_APP_URL }} | ||
|
||
steps: | ||
- name: Download artifact from build job | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: node-app | ||
|
||
- name: 'Deploy to Azure Web App' | ||
id: deploy-to-webapp | ||
uses: azure/webapps-deploy@v2 | ||
with: | ||
app-name: mental-health-app-web | ||
slot-name: 'Production' | ||
publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }} | ||
package: . |
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,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2024 DHRUMIL PATEL | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
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
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
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
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
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
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
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
Oops, something went wrong.