Skip to content

Commit 1f4f881

Browse files
authored
Merged DEV into TEST
Merged DEV into TEST
2 parents 65f13fa + 2e6bf98 commit 1f4f881

File tree

4 files changed

+227
-1
lines changed

4 files changed

+227
-1
lines changed

.github/workflows/dev.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: CI for Dev
2+
3+
# Controls when the action will run.
4+
on:
5+
# Triggers the workflow on push events but only for the dev branch
6+
push:
7+
branches: [ dev ]
8+
9+
# Allows you to run this workflow manually from the Actions tab
10+
workflow_dispatch:
11+
12+
env:
13+
AZURE_SLOT_NAME: dev # The name of the target Deployment Slot
14+
AZURE_WEBAPP_NAME: m365-galleries-mcp # The name of the Web App for hosting WebAPI
15+
DOTNET_VERSION: '10.0.x' # The dot net version to use
16+
17+
jobs:
18+
# This job builds the Web App project
19+
build-webapp:
20+
runs-on: self-hosted
21+
22+
steps:
23+
# This step checks out the repository so that the workflow can access its contents
24+
- name: Checkout repository
25+
uses: actions/checkout@v4
26+
27+
# This step sets up the .NET environment required for building the project
28+
- name: Setup .NET
29+
uses: actions/setup-dotnet@v4
30+
with:
31+
dotnet-version: ${{env.DOTNET_VERSION}}
32+
33+
# This step builds the Web App project using the specified .NET version
34+
- name: 'Build Web App with .NET ${{env.DOTNET_VERSION}}'
35+
run: dotnet build --configuration Release ./src/SampleGalleriesMCPServerHttp/SampleGalleriesMCPServerHttp.csproj
36+
37+
# This step publishes the Web App project, preparing it for deployment
38+
- name: Publish Web App project
39+
run: dotnet publish -c release -r win-x64 --self-contained true -o '${{env.DOTNET_ROOT}}/webapp' ./src/SampleGalleriesMCPServerHttp/SampleGalleriesMCPServerHttp.csproj
40+
41+
# Now upload all the artifacts for publishing
42+
- name: Upload Web App artifact for deployment job
43+
uses: actions/upload-artifact@v4
44+
with:
45+
name: webapp-artifacts
46+
path: ${{env.DOTNET_ROOT}}/webapp
47+
48+
# This job deploys the Web App project
49+
deploy-webapp:
50+
runs-on: self-hosted
51+
needs: build-webapp
52+
53+
steps:
54+
# Login to Azure using the Azure CLI for deployment
55+
- name: Login via Azure CLI for deployment
56+
uses: azure/login@v2
57+
with:
58+
auth-type: IDENTITY
59+
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
60+
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
61+
enable-AzPSSession: true
62+
63+
# Download the Web App artifact from the build job
64+
- name: Download Web App artifact from build job
65+
uses: actions/download-artifact@v4
66+
with:
67+
name: webapp-artifacts
68+
path: '${{env.DOTNET_ROOT}}/webapp'
69+
70+
# Deploy the Web App to the specified Azure slot
71+
- name: 'Deploy Web App to Azure Web App ${{env.AZURE_SLOT_NAME}}'
72+
uses: azure/webapps-deploy@v2
73+
with:
74+
app-name: ${{env.AZURE_WEBAPP_NAME}}
75+
slot-name: ${{env.AZURE_SLOT_NAME}}
76+
package: '${{env.DOTNET_ROOT}}/webapp'

.github/workflows/main.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: CI for Dev
2+
3+
# Controls when the action will run.
4+
on:
5+
# Triggers the workflow on push events but only for the dev branch
6+
push:
7+
branches: [ main ]
8+
9+
# Allows you to run this workflow manually from the Actions tab
10+
workflow_dispatch:
11+
12+
env:
13+
AZURE_WEBAPP_NAME: m365-galleries-mcp # The name of the Web App for hosting WebAPI
14+
DOTNET_VERSION: '10.0.x' # The dot net version to use
15+
16+
jobs:
17+
# This job builds the Web App project
18+
build-webapp:
19+
runs-on: self-hosted
20+
21+
steps:
22+
# This step checks out the repository so that the workflow can access its contents
23+
- name: Checkout repository
24+
uses: actions/checkout@v4
25+
26+
# This step sets up the .NET environment required for building the project
27+
- name: Setup .NET
28+
uses: actions/setup-dotnet@v4
29+
with:
30+
dotnet-version: ${{env.DOTNET_VERSION}}
31+
32+
# This step builds the Web App project using the specified .NET version
33+
- name: 'Build Web App with .NET ${{env.DOTNET_VERSION}}'
34+
run: dotnet build --configuration Release ./src/SampleGalleriesMCPServerHttp/SampleGalleriesMCPServerHttp.csproj
35+
36+
# This step publishes the Web App project, preparing it for deployment
37+
- name: Publish Web App project
38+
run: dotnet publish -c release -r win-x64 --self-contained true -o '${{env.DOTNET_ROOT}}/webapp' ./src/SampleGalleriesMCPServerHttp/SampleGalleriesMCPServerHttp.csproj
39+
40+
# Now upload all the artifacts for publishing
41+
- name: Upload Web App artifact for deployment job
42+
uses: actions/upload-artifact@v4
43+
with:
44+
name: webapp-artifacts
45+
path: ${{env.DOTNET_ROOT}}/webapp
46+
47+
# This job deploys the Web App project
48+
deploy-webapp:
49+
runs-on: self-hosted
50+
needs: build-webapp
51+
52+
steps:
53+
# Login to Azure using the Azure CLI for deployment
54+
- name: Login via Azure CLI for deployment
55+
uses: azure/login@v2
56+
with:
57+
auth-type: IDENTITY
58+
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
59+
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
60+
enable-AzPSSession: true
61+
62+
# Download the Web App artifact from the build job
63+
- name: Download Web App artifact from build job
64+
uses: actions/download-artifact@v4
65+
with:
66+
name: webapp-artifacts
67+
path: '${{env.DOTNET_ROOT}}/webapp'
68+
69+
# Deploy the Web App to the specified Azure slot
70+
- name: 'Deploy Web App to Azure Web App ${{env.AZURE_SLOT_NAME}}'
71+
uses: azure/webapps-deploy@v2
72+
with:
73+
app-name: ${{env.AZURE_WEBAPP_NAME}}
74+
package: '${{env.DOTNET_ROOT}}/webapp'

.github/workflows/test.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: CI for Dev
2+
3+
# Controls when the action will run.
4+
on:
5+
# Triggers the workflow on push events but only for the dev branch
6+
push:
7+
branches: [ test ]
8+
9+
# Allows you to run this workflow manually from the Actions tab
10+
workflow_dispatch:
11+
12+
env:
13+
AZURE_SLOT_NAME: test # The name of the target Deployment Slot
14+
AZURE_WEBAPP_NAME: m365-galleries-mcp # The name of the Web App for hosting WebAPI
15+
DOTNET_VERSION: '10.0.x' # The dot net version to use
16+
17+
jobs:
18+
# This job builds the Web App project
19+
build-webapp:
20+
runs-on: self-hosted
21+
22+
steps:
23+
# This step checks out the repository so that the workflow can access its contents
24+
- name: Checkout repository
25+
uses: actions/checkout@v4
26+
27+
# This step sets up the .NET environment required for building the project
28+
- name: Setup .NET
29+
uses: actions/setup-dotnet@v4
30+
with:
31+
dotnet-version: ${{env.DOTNET_VERSION}}
32+
33+
# This step builds the Web App project using the specified .NET version
34+
- name: 'Build Web App with .NET ${{env.DOTNET_VERSION}}'
35+
run: dotnet build --configuration Release ./src/SampleGalleriesMCPServerHttp/SampleGalleriesMCPServerHttp.csproj
36+
37+
# This step publishes the Web App project, preparing it for deployment
38+
- name: Publish Web App project
39+
run: dotnet publish -c release -r win-x64 --self-contained true -o '${{env.DOTNET_ROOT}}/webapp' ./src/SampleGalleriesMCPServerHttp/SampleGalleriesMCPServerHttp.csproj
40+
41+
# Now upload all the artifacts for publishing
42+
- name: Upload Web App artifact for deployment job
43+
uses: actions/upload-artifact@v4
44+
with:
45+
name: webapp-artifacts
46+
path: ${{env.DOTNET_ROOT}}/webapp
47+
48+
# This job deploys the Web App project
49+
deploy-webapp:
50+
runs-on: self-hosted
51+
needs: build-webapp
52+
53+
steps:
54+
# Login to Azure using the Azure CLI for deployment
55+
- name: Login via Azure CLI for deployment
56+
uses: azure/login@v2
57+
with:
58+
auth-type: IDENTITY
59+
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
60+
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
61+
enable-AzPSSession: true
62+
63+
# Download the Web App artifact from the build job
64+
- name: Download Web App artifact from build job
65+
uses: actions/download-artifact@v4
66+
with:
67+
name: webapp-artifacts
68+
path: '${{env.DOTNET_ROOT}}/webapp'
69+
70+
# Deploy the Web App to the specified Azure slot
71+
- name: 'Deploy Web App to Azure Web App ${{env.AZURE_SLOT_NAME}}'
72+
uses: azure/webapps-deploy@v2
73+
with:
74+
app-name: ${{env.AZURE_WEBAPP_NAME}}
75+
slot-name: ${{env.AZURE_SLOT_NAME}}
76+
package: '${{env.DOTNET_ROOT}}/webapp'

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Microsoft 365 Galleries MCP Servers
22

3-
MCP Servers for the Microsoft 365 & Power Platform Community Samples Gallery
3+
MCP Servers for the Microsoft 365 & Power Platform Community Samples Gallery.
44

55
## Overview
66

0 commit comments

Comments
 (0)