-
Notifications
You must be signed in to change notification settings - Fork 2
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
5 changed files
with
165 additions
and
0 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,46 @@ | ||
name: Build and deploy .NET Core application to Function App Plex-Crawler | ||
on: | ||
push: | ||
branches: | ||
- master | ||
env: | ||
AZURE_FUNCTIONAPP_NAME: Plex-Crawler | ||
AZURE_FUNCTIONAPP_PACKAGE_PATH: PlexCrawler\published | ||
CONFIGURATION: Release | ||
DOTNET_CORE_VERSION: 7.0.x | ||
WORKING_DIRECTORY: PlexCrawler | ||
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: Publish | ||
run: dotnet publish "${{ env.WORKING_DIRECTORY }}" --configuration ${{ env.CONFIGURATION }} --no-build --output "${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}" | ||
- name: Publish Artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: functionapp | ||
path: ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }} | ||
deploy: | ||
runs-on: windows-latest | ||
needs: build | ||
steps: | ||
- name: Download artifact from build job | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: functionapp | ||
path: ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }} | ||
- name: Deploy to Azure Function App | ||
uses: Azure/functions-action@v1 | ||
with: | ||
app-name: ${{ env.AZURE_FUNCTIONAPP_NAME }} | ||
publish-profile: ${{ secrets.Plex_Crawler_D48F }} | ||
package: ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }} |
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,32 @@ | ||
name: Build and deploy .NET Core application to Function App Plex-Crawler | ||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- reopened | ||
env: | ||
AZURE_FUNCTIONAPP_NAME: Plex-Crawler | ||
AZURE_FUNCTIONAPP_PACKAGE_PATH: PlexCrawler\published | ||
CONFIGURATION: Release | ||
DOTNET_CORE_VERSION: 7.0.x | ||
WORKING_DIRECTORY: PlexCrawler | ||
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: Publish | ||
run: dotnet publish "${{ env.WORKING_DIRECTORY }}" --configuration ${{ env.CONFIGURATION }} --no-build --output "${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}" | ||
- name: Publish Artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: functionapp | ||
path: ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }} |
70 changes: 70 additions & 0 deletions
70
Crawler/PlexCrawler/Properties/ServiceDependencies/Plex-Crawler/storage1.arm.json
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,70 @@ | ||
{ | ||
"$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#", | ||
"contentVersion": "1.0.0.0", | ||
"parameters": { | ||
"resourceGroupName": { | ||
"type": "string", | ||
"defaultValue": "crawlers", | ||
"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": "canadaeast", | ||
"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('plexcrawlerstorage', 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": [ | ||
{ | ||
"sku": { | ||
"name": "Standard_LRS", | ||
"tier": "Standard" | ||
}, | ||
"kind": "Storage", | ||
"name": "plexcrawlerstorage", | ||
"type": "Microsoft.Storage/storageAccounts", | ||
"location": "[parameters('resourceLocation')]", | ||
"apiVersion": "2017-10-01" | ||
} | ||
] | ||
} | ||
} | ||
} | ||
], | ||
"metadata": { | ||
"_dependencyType": "storage.azure" | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
Crawler/PlexCrawler/Properties/serviceDependencies.Plex-Crawler.json
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,9 @@ | ||
{ | ||
"dependencies": { | ||
"storage1": { | ||
"resourceId": "/subscriptions/[parameters('subscriptionId')]/resourceGroups/[parameters('resourceGroupName')]/providers/Microsoft.Storage/storageAccounts/plexcrawlerstorage", | ||
"type": "storage.azure", | ||
"connectionId": "AzureWebJobsStorage" | ||
} | ||
} | ||
} |
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,8 @@ | ||
{ | ||
"dependencies": { | ||
"storage1": { | ||
"type": "storage", | ||
"connectionId": "AzureWebJobsStorage" | ||
} | ||
} | ||
} |