Skip to content

Commit

Permalink
deployment changes
Browse files Browse the repository at this point in the history
  • Loading branch information
m3c-ode committed Nov 23, 2023
1 parent 7040bf5 commit 854ecc5
Show file tree
Hide file tree
Showing 4 changed files with 141 additions and 1 deletion.
48 changes: 48 additions & 0 deletions .github/workflows/LeaveManagementWeb20231123090405.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Build and deploy .NET Core application to Web App LeaveManagementWeb20231123090405
on:
push:
branches:
- main
env:
AZURE_WEBAPP_NAME: LeaveManagementWeb20231123090405
AZURE_WEBAPP_PACKAGE_PATH: LeaveManagement.Web\published
CONFIGURATION: Release
DOTNET_CORE_VERSION: 7.0.x
WORKING_DIRECTORY: LeaveManagement.Web
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET SDK
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ env.DOTNET_CORE_VERSION }}
- name: Restore
run: dotnet restore "${{ env.WORKING_DIRECTORY }}"
- name: Build
run: dotnet build "${{ env.WORKING_DIRECTORY }}" --configuration ${{ env.CONFIGURATION }} --no-restore
- name: Test
run: dotnet test "${{ env.WORKING_DIRECTORY }}" --no-build
- name: Publish
run: dotnet publish "${{ env.WORKING_DIRECTORY }}" --configuration ${{ env.CONFIGURATION }} --no-build --output "${{ env.AZURE_WEBAPP_PACKAGE_PATH }}"
- name: Publish Artifacts
uses: actions/upload-artifact@v3
with:
name: webapp
path: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }}
deploy:
runs-on: windows-latest
needs: build
steps:
- name: Download artifact from build job
uses: actions/download-artifact@v3
with:
name: webapp
path: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }}
- name: Deploy to Azure WebApp
uses: azure/webapps-deploy@v2
with:
app-name: ${{ env.AZURE_WEBAPP_NAME }}
publish-profile: ${{ secrets.LeaveManagementWeb20231123090405_3C81 }}
package: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
{
"$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"resourceGroupName": {
"type": "string",
"defaultValue": "LeaveManagementWeb-App-Rg",
"metadata": {
"_parameterType": "resourceGroup",
"description": "Name of the resource group for the resource. It is recommended to put resources under same resource group for better tracking."
}
},
"resourceGroupLocation": {
"type": "string",
"defaultValue": "eastus",
"metadata": {
"_parameterType": "location",
"description": "Location of the resource group. Resource groups could have different location than resources."
}
},
"resourceLocation": {
"type": "string",
"defaultValue": "[parameters('resourceGroupLocation')]",
"metadata": {
"_parameterType": "location",
"description": "Location of the resource. By default use resource group's location, unless the resource provider is not supported there."
}
}
},
"resources": [
{
"type": "Microsoft.Resources/resourceGroups",
"name": "[parameters('resourceGroupName')]",
"location": "[parameters('resourceGroupLocation')]",
"apiVersion": "2019-10-01"
},
{
"type": "Microsoft.Resources/deployments",
"name": "[concat(parameters('resourceGroupName'), 'Deployment', uniqueString(concat('LeaveManagementNet7', subscription().subscriptionId)))]",
"resourceGroup": "[parameters('resourceGroupName')]",
"apiVersion": "2019-10-01",
"dependsOn": [
"[parameters('resourceGroupName')]"
],
"properties": {
"mode": "Incremental",
"template": {
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"resources": [
{
"kind": "v12.0",
"location": "[parameters('resourceLocation')]",
"name": "leavemanagementnet7dbserver",
"type": "Microsoft.Sql/servers",
"apiVersion": "2017-10-01-preview"
},
{
"sku": {
"name": "Standard",
"tier": "Standard",
"capacity": 10
},
"kind": "v12.0,user",
"location": "[parameters('resourceLocation')]",
"name": "leavemanagementnet7dbserver/LeaveManagementNet7",
"type": "Microsoft.Sql/servers/databases",
"apiVersion": "2017-10-01-preview",
"dependsOn": [
"leavemanagementnet7dbserver"
]
}
]
}
}
}
],
"metadata": {
"_dependencyType": "mssql.azure"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"dependencies": {
"mssql1": {
"secretStore": "AzureAppSettings",
"resourceId": "/subscriptions/[parameters('subscriptionId')]/resourceGroups/[parameters('resourceGroupName')]/providers/Microsoft.Sql/servers/leavemanagementnet7dbserver/databases/LeaveManagementNet7",
"type": "mssql.azure",
"connectionId": "ConnectionStrings:DefaultConnection",
"dynamicId": null
}
}
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ The Employee Leave Manager application has been successfully deployed using the

- IIS (Internet Information Services): The application has been published and hosted on a local IIS server for testing purposes.
- SQL Server: The application is integrated with a SQL Server database to store and manage data related to employees, leave types, and leave requests.
- Microsoft Azure: The application has been deployed to Microsoft Azure cloud platform and can be accessed using the following address: [https://leavemanagementweb20230616123130.azurewebsites.net](https://leavemanagementweb20230616123130.azurewebsites.net). Currently offline due to subscription change.
- Microsoft Azure: The application has been deployed to Microsoft Azure cloud platform and can be accessed using the following address: [https://leavemanagementweb20231123090405.azurewebsites.net](https://leavemanagementweb20231123090405.azurewebsites.net). Currently offline due to subscription change.

## Contact

Expand Down

0 comments on commit 854ecc5

Please sign in to comment.