Skip to content

Commit

Permalink
Merge f04273f into 242f7f6
Browse files Browse the repository at this point in the history
  • Loading branch information
dr1rrb authored Apr 24, 2023
2 parents 242f7f6 + f04273f commit 762f79d
Show file tree
Hide file tree
Showing 5 changed files with 165 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/Plex-Crawler-CD.yml
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 }}
32 changes: 32 additions & 0 deletions .github/workflows/Plex-Crawler-CI.yml
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 }}
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"
}
}
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"
}
}
}
8 changes: 8 additions & 0 deletions Crawler/PlexCrawler/Properties/serviceDependencies.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"dependencies": {
"storage1": {
"type": "storage",
"connectionId": "AzureWebJobsStorage"
}
}
}

0 comments on commit 762f79d

Please sign in to comment.