Skip to content

Commit f719c49

Browse files
authored
Merge branch 'vikramlearning:main' into main
2 parents 47755e0 + 27fee72 commit f719c49

113 files changed

Lines changed: 1409 additions & 18219 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# This workflow will build and push a web application to an Azure Static Web App when you change your code.
2+
#
3+
# This workflow assumes you have already created the target Azure Static Web App.
4+
# For instructions see https://docs.microsoft.com/azure/static-web-apps/get-started-portal?tabs=vanilla-javascript
5+
#
6+
# To configure this workflow:
7+
#
8+
# 1. Set up a secret in your repository named AZURE_STATIC_WEB_APPS_API_TOKEN with the value of your Static Web Apps deployment token.
9+
# For instructions on obtaining the deployment token see: https://docs.microsoft.com/azure/static-web-apps/deployment-token-management
10+
#
11+
# 3. Change the values for the APP_LOCATION, API_LOCATION and APP_ARTIFACT_LOCATION, AZURE_STATIC_WEB_APPS_API_TOKEN environment variables (below).
12+
# For instructions on setting up the appropriate configuration values go to https://docs.microsoft.com/azure/static-web-apps/front-end-frameworks
13+
name: Deploy web app to Azure Static Web Apps
14+
15+
on:
16+
push:
17+
branches: [ "main" ]
18+
pull_request:
19+
types: [opened, synchronize, reopened, closed]
20+
branches: [ "main" ]
21+
22+
# Environment variables available to all jobs and steps in this workflow
23+
env:
24+
APP_LOCATION: "/" # location of your client code
25+
API_LOCATION: "api" # location of your api source code - optional
26+
APP_ARTIFACT_LOCATION: "build" # location of client code build output
27+
AZURE_STATIC_WEB_APPS_API_TOKEN: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN }} # secret containing deployment token for your static web app
28+
29+
permissions:
30+
contents: read
31+
32+
jobs:
33+
build_and_deploy_job:
34+
permissions:
35+
contents: read # for actions/checkout to fetch code
36+
pull-requests: write # for Azure/static-web-apps-deploy to comment on PRs
37+
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed')
38+
runs-on: ubuntu-latest
39+
name: Build and Deploy Job
40+
steps:
41+
- uses: actions/checkout@v4
42+
with:
43+
submodules: true
44+
- name: Build And Deploy
45+
id: builddeploy
46+
uses: Azure/static-web-apps-deploy@v1
47+
with:
48+
azure_static_web_apps_api_token: ${{ env.AZURE_STATIC_WEB_APPS_API_TOKEN }} # secret containing api token for app
49+
repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments)
50+
action: "upload"
51+
###### Repository/Build Configurations - These values can be configured to match you app requirements. ######
52+
# For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig
53+
app_location: ${{ env.APP_LOCATION }}
54+
api_location: ${{ env.API_LOCATION }}
55+
app_artifact_location: ${{ env.APP_ARTIFACT_LOCATION }}
56+
###### End of Repository/Build Configurations ######
57+
58+
close_pull_request_job:
59+
permissions:
60+
contents: none
61+
if: github.event_name == 'pull_request' && github.event.action == 'closed'
62+
runs-on: ubuntu-latest
63+
name: Close Pull Request Job
64+
steps:
65+
- name: Close Pull Request
66+
id: closepullrequest
67+
uses: Azure/static-web-apps-deploy@v1
68+
with:
69+
azure_static_web_apps_api_token: ${{ env.AZURE_STATIC_WEB_APPS_API_TOKEN }} # secret containing api token for app
70+
action: "close"

.github/workflows/static-web-app.yml

Lines changed: 36 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -18,36 +18,54 @@ on:
1818

1919
jobs:
2020
build_and_deploy_job:
21-
if: ${{ inputs.prod_release }} || (github.event_name == 'pull_request' && github.event.action != 'closed')
21+
# Run when:
22+
# - workflow_dispatch AND prod_release == true
23+
# - OR pull_request (except when closed)
24+
if: >
25+
(github.event_name == 'workflow_dispatch' && github.event.inputs.prod_release == 'true') ||
26+
(github.event_name == 'pull_request' && github.event.action != 'closed')
2227
runs-on: ubuntu-latest
2328
name: Build and Deploy Job
2429
steps:
25-
- uses: actions/checkout@v2
30+
- uses: actions/checkout@v5
2631
with:
2732
submodules: true
2833

29-
- name: Setup .NET Core SDK
30-
uses: actions/setup-dotnet@v1
34+
- name: Setup .NET SDK
35+
uses: actions/setup-dotnet@v5
3136
with:
32-
dotnet-version: '9.0.x'
37+
dotnet-version: '10.0.x'
3338

34-
- name: Build And Deploy
39+
- name: Install WASM workload
40+
run: dotnet workload install wasm-tools --skip-manifest-update
41+
42+
- name: Restore
43+
run: dotnet restore
44+
45+
- name: Publish app (produce static assets)
46+
run: dotnet publish BlazorBootstrap.Demo.WebAssembly -c Release -o build
47+
48+
- name: Show published files (debug)
49+
run: |
50+
echo "repo root tree (top-level):"
51+
ls -la .
52+
echo "build folder tree:"
53+
ls -la build || true
54+
echo "build/wwwroot tree:"
55+
ls -la build/wwwroot || true
56+
echo "index.html exists?"
57+
if [ -f build/wwwroot/index.html ]; then echo "FOUND"; else echo "MISSING"; fi
58+
59+
- name: Build And Deploy (upload artifacts; skip Oryx build)
3560
id: builddeploy
3661
uses: Azure/static-web-apps-deploy@v1
3762
with:
38-
dotnet-version: '9.0.x'
3963
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_GRAY_WAVE_0E4848710 }}
40-
skip_deploy_on_missing_secrets: true
41-
repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments)
64+
repo_token: ${{ secrets.GITHUB_TOKEN }}
4265
action: "upload"
43-
###### Repository/Build Configurations - These values can be configured to match your app requirements. ######
44-
# For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig
45-
app_location: "BlazorBootstrap.Demo.WebAssembly" # App source code path
46-
#api_location: "Api" # Api source code path - optional
47-
#output_location: "build/wwwroot" # Built app content directory - optional
48-
output_location: "wwwroot" # Built app content directory - optional
49-
app_build_command: 'dotnet publish --configuration Release --output build'
50-
###### End of Repository/Build Configurations ######
66+
app_location: "." # repository root
67+
skip_app_build: true # we already produced the build on runner
68+
app_artifact_location: "build/wwwroot" # <-- IMPORTANT: point to the published static files
5169

5270
close_pull_request_job:
5371
if: github.event_name == 'pull_request' && github.event.action == 'closed'
@@ -59,5 +77,4 @@ jobs:
5977
uses: Azure/static-web-apps-deploy@v1
6078
with:
6179
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_GRAY_WAVE_0E4848710 }}
62-
skip_deploy_on_missing_secrets: true
63-
action: "close"
80+
action: "close"

.github/workflows/web-app.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,18 @@ jobs:
1717
runs-on: windows-latest
1818

1919
steps:
20-
- uses: actions/checkout@v2
20+
- uses: actions/checkout@v4
2121

22-
- name: Set up .NET 9.0.x
23-
uses: actions/setup-dotnet@v1
22+
- name: Set up .NET 10.0.x
23+
uses: actions/setup-dotnet@v3
2424
with:
25-
dotnet-version: '9.0.x'
26-
include-prerelease: false
25+
dotnet-version: '10.0.x'
2726

2827
- name: Build
2928
run: dotnet build ./BlazorBootstrap.Demo.Server/BlazorBootstrap.Demo.Server.csproj --configuration Release
3029

3130
- name: Publish
32-
run: dotnet publish ./BlazorBootstrap.Demo.Server/BlazorBootstrap.Demo.Server.csproj -c Release -o ${{env.DOTNET_ROOT}}/myapp
31+
run: dotnet publish ./BlazorBootstrap.Demo.Server/BlazorBootstrap.Demo.Server.csproj -c Release -o "${{env.DOTNET_ROOT}}/myapp"
3332

3433
- name: Upload artifact for deployment job
3534
uses: actions/upload-artifact@v4

BlazorBootstrap.Demo.Hosted/Client/App.razor

Lines changed: 0 additions & 12 deletions
This file was deleted.

BlazorBootstrap.Demo.Hosted/Client/BlazorBootstrap.Demo.Hosted.Client.csproj

Lines changed: 0 additions & 19 deletions
This file was deleted.

BlazorBootstrap.Demo.Hosted/Client/Program.cs

Lines changed: 0 additions & 8 deletions
This file was deleted.

BlazorBootstrap.Demo.Hosted/Client/Properties/launchSettings.json

Lines changed: 0 additions & 30 deletions
This file was deleted.

BlazorBootstrap.Demo.Hosted/Client/Usings.cs

Lines changed: 0 additions & 2 deletions
This file was deleted.

BlazorBootstrap.Demo.Hosted/Client/_Imports.razor

Lines changed: 0 additions & 10 deletions
This file was deleted.

BlazorBootstrap.Demo.Hosted/Client/wwwroot/appsettings.json

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)