Skip to content

Commit

Permalink
Adding CI and fixing up a readme (#1)
Browse files Browse the repository at this point in the history
* Adding some initial deploy assets

* modifying readme and package ref for validation

* Attempting to fix arm location ***NO_CI***

* Adding back location

* Fixing deploy template
  • Loading branch information
timheuer authored Jul 3, 2020
1 parent 5897e8b commit e9c7e71
Show file tree
Hide file tree
Showing 9 changed files with 216 additions and 14 deletions.
6 changes: 6 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extensions": [
"ms-vscode.csharp",
"formulahendry.dotnet-test-explorer"
]
}
30 changes: 30 additions & 0 deletions .github/workflows/build-CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Build Blazor App

on: [push, pull_request]

jobs:
build:
if: github.event_name == 'push' && contains(toJson(github.event.commits), '***NO_CI***') == false && contains(toJson(github.event.commits), '[ci skip]') == false && contains(toJson(github.event.commits), '[skip ci]') == false
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.300

- name: Restore
run: dotnet restore

- name: Build with dotnet
run: dotnet build --configuration Release --no-restore

- name: Publish with dotnet
run: dotnet publish --configuration Release -o published_app --no-build

- name: Publish artifacts
uses: actions/upload-artifact@v2
with:
name: webapp
path: published_app
29 changes: 29 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
// Use IntelliSense to find out which attributes exist for C# debugging
// Use hover for the description of the existing attributes
// For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
"version": "0.2.0",
"configurations": [
{
"name": ".NET Core Launch (Blazor Standalone)",
"type": "coreclr",
"request": "launch",
"program": "dotnet",
"args": ["run"],
"cwd": "${workspaceFolder}/Server",
"env": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
{
"name": ".NET Core Debug Blazor Web Assembly in Chrome",
"type": "pwa-chrome",
"request": "launch",
"timeout": 30000,
// If you have changed the default port / launch URL make sure to update the expectation below
"url": "https://localhost:5001",
"webRoot": "${workspaceFolder}/Server",
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}"
}
]
}
42 changes: 42 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/Server/CarChecker.Server.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
},
{
"label": "publish",
"command": "dotnet",
"type": "process",
"args": [
"publish",
"${workspaceFolder}/Server/CarChecker.Server.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
},
{
"label": "watch",
"command": "dotnet",
"type": "process",
"args": [
"watch",
"run",
"${workspaceFolder}/Server/CarChecker.Server.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
}
]
}
6 changes: 3 additions & 3 deletions Client/CarChecker.Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
<ItemGroup>
<PackageReference Include="BlazorInputFile" Version="0.2.0" />
<PackageReference Include="SceneViewer" Version="0.1.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.DataAnnotations.Validation" Version="3.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.DataAnnotations.Validation" Version="3.2.0-rc1.20223.4" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="3.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Build" Version="3.2.0" PrivateAssets="all" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="3.2.0" PrivateAssets="all" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Authentication" Version="3.2.0" />
<PackageReference Include="Microsoft.Extensions.Localization" Version="3.1.3" />
<PackageReference Include="Microsoft.Extensions.Http" Version="3.1.3" />
<PackageReference Include="Microsoft.Extensions.Localization" Version="3.1.4" />
<PackageReference Include="Microsoft.Extensions.Http" Version="3.1.4" />
<PackageReference Include="System.Net.Http.Json" Version="3.2.0" />
</ItemGroup>

Expand Down
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# CarChecker - a Blazor sample app
This is a sample application for [Blazor](https://blazor.net) which was presented at Build 2020. You can view the on-demand walk-through for this on Channel 9: [Modern Web UI with Blazor WebAssembly](https://aka.ms/blazor-in-action).

To use this it's best to have Visual Studio 2019 and the latest .NET SDK for the Blazor release which you can read about here: [Blazor WebAssembly 3.2.0 now available](https://devblogs.microsoft.com/aspnet/blazor-webassembly-3-2-0-now-available/).

## What this sample has:
This is a great sample which has a lot of Blazor + ASP.NET integrations such as:
- client-side debugging with Visual Studio
- Authentication / Authorization
- input validation
- data integration/sync
- Blazor components
- code sharing
- JavaScript interop
- Localization / internationalization
- Progressive Web App (PWA)

## Deploy to Azure
You can create the resource (Free SKU App Service) in Azure quickly by clicking below and then can use Visual Studio to select the App Service and deploy the code to it later.

[![Deploy to Azure](https://aka.ms/deploytoazurebutton)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2Ftimheuer%2FCarChecker%2Fmaster%2Fdeploy.json)

### Remarks
This sample makes use of a preview package for Validation.
73 changes: 73 additions & 0 deletions deploy.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"webAppName": {
"type": "string",
"defaultValue": "[concat('BlazorApp-', uniqueString(resourceGroup().id))]",
"metadata":{
"description": "That name is the name of our application. It has to be unique. Type a name followed by your resource group name. (<name>-<resourceGroupName>)"
}
},
"location": {
"type": "string",
"defaultValue": "[resourceGroup().location]",
"metadata":{
"description": "Location for all resources."
}
}
},
"variables": {
"alwaysOn": false,
"sku": "Free",
"skuCode": "F1",
"workerSize": "0",
"workerSizeId": 0,
"numberOfWorkers": "1",
"currentStack": "dotnetcore",
"netFrameworkVersion": "v4.0",
"hostingPlanName": "[concat('hpn-', resourceGroup().name)]"
},
"resources": [
{
"apiVersion": "2018-02-01",
"name": "[parameters('webAppName')]",
"type": "Microsoft.Web/sites",
"location": "[parameters('location')]",
"dependsOn": [
"[resourceId('Microsoft.Web/serverfarms/', variables('hostingPlanName'))]"
],
"properties": {
"name": "[parameters('webAppName')]",
"siteConfig": {
"metadata": [
{
"name": "CURRENT_STACK",
"value": "[variables('currentStack')]"
}
],
"netFrameworkVersion": "[variables('netFrameworkVersion')]",
"alwaysOn": "[variables('alwaysOn')]"
},
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('hostingPlanName'))]",
"clientAffinityEnabled": true
}
},
{
"apiVersion": "2018-02-01",
"name": "[variables('hostingPlanName')]",
"type": "Microsoft.Web/serverfarms",
"location": "[parameters('location')]",
"properties": {
"name": "[variables('hostingPlanName')]",
"workerSize": "[variables('workerSize')]",
"workerSizeId": "[variables('workerSizeId')]",
"numberOfWorkers": "[variables('numberOfWorkers')]"
},
"sku": {
"Tier": "[variables('sku')]",
"Name": "[variables('skuCode')]"
}
}
]
}
9 changes: 9 additions & 0 deletions deploy.parameters.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"webAppName": {
"value": "GEN-UNIQUE"
}
}
}
11 changes: 0 additions & 11 deletions nuget.config

This file was deleted.

0 comments on commit e9c7e71

Please sign in to comment.