Although my action, azure-static-web-apps-agreeable-sky-odd2be310.yml, appears to build and deploy correctly (green check), my app does not load. If I open the Build and Deploy job, and look at the Build and Deploy section I see:
Try to validate location at: '/github/workspace/FoodTruckNotification/FoodTruckNotification.Wasm/bin/Release/net7.0/dist'.
App Directory Location: 'FoodTruckNotification/FoodTruckNotification.Wasm/bin/Release/net7.0/dist' was found.
Try to validate location at: '/github/workspace/swa-db-connections'.
Looking for event info
Starting to build app with Oryx
Azure Static Web Apps utilizes Oryx to build both static applications and Azure Functions. You can find more details on Oryx here: https://github.com/microsoft/Oryx
Oryx will build app with the following custom override command: dotnet build
---Oryx build logs---
Operation performed by Microsoft Oryx, https://github.com/Microsoft/Oryx
You can report issues at https://github.com/Microsoft/Oryx/issues
Oryx Version: 0.2.20230717.2, Commit: 174f4287104c15e6f9ea3a4cf6e9f80accba3cf3, ReleaseTagName: 20230717.2
Build Operation ID: 1074f932d13cc62b
OS Type : bullseye
Image Type : jamstack
Detecting platforms...
Could not detect any platform in the source directory.
Error: Could not detect the language from repo.
---End of Oryx build logs---
Oryx was unable to determine the build steps. Continuing assuming the assets in this folder are already built. If this is an unexpected behavior please contact support.
Finished building app with Oryx
Using 'staticwebapp.config.json' file for configuration information, 'routes.json' will be ignored.
No Api directory specified. Azure Functions will not be created.
Either no Api directory was specified, or the specified directory was not found. Azure Functions will not be created.
Zipping App Artifacts
Done Zipping App Artifacts
Uploading build artifacts.
Finished Upload. Polling on deployment.
Status: InProgress. Time: 0.0600334(s)
Status: Succeeded. Time: 15.1100465(s)
Deployment Complete :)
Visit your site at: https://agreeable-sky-0dd2be310-63.centralus.3.azurestaticapps.net
Unexectedly failed to add GitHub comment.
Thanks for using Azure Static Web Apps!
Exiting
I have looked at the online help and made adjustments to my action, including removing the api_location and adding the app_build_command to the build and deploy section.
name: Azure Static Web Apps CI/CD
on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened, closed]
branches:
- master
jobs:
build_and_deploy_job:
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed')
runs-on: ubuntu-latest
name: Build and Deploy Job
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Setup dotnet
uses: actions/setup-dotnet@v3.2.0
with:
dotnet-version: '7.0.100'
- run: |
cd FoodTruckNotification/FoodTruckNotification.Wasm
dotnet restore
dotnet build -c Release
- name: Build And Deploy
id: builddeploy
uses: Azure/static-web-apps-deploy@v1
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_AGREEABLE_SKY_0DD2BE310 }}
repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments)
action: "upload"
###### Repository/Build Configurations - These values can be configured to match your app requirements. ######
# For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig
app_location: "FoodTruckNotification/FoodTruckNotification.Wasm/bin/Release/net7.0/dist" # App source code path
### api_location: "" # Api source code path - optional
output_location: "FoodTruckNotification/FoodTruckNotification.Wasm/bin/Release/net7.0/publish/wwwroot" # Built app content directory - optional
app_build_command: "dotnet build"
###### End of Repository/Build Configurations ######
close_pull_request_job:
if: github.event_name == 'pull_request' && github.event.action == 'closed'
runs-on: ubuntu-latest
name: Close Pull Request Job
steps:
- name: Close Pull Request
id: closepullrequest
uses: Azure/static-web-apps-deploy@v1
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_AGREEABLE_SKY_0DD2BE310 }}
action: "close"