Hi,
I am trying to create a SWA that links to GitHub, but I am having some issues.
I am building a website with Retype - I assume that the steps that it accomplishes does not fit well with what the SWA is trying to do. Retype "automatically builds your website upon each commit to the main branch, and then deploys your new Retype powered website to a retype branch."
The SWA, however, is trying to build from the main branch. Every time it runs, I get errors which seem to basically say that the app/files location can't be found (see below for errors).
While anything that I say is speculation, I am supposing that the azure-static-web-apps-<RANDOM_NAME>.yml found in workflow can only look in the main branch - which is the default. Since Retype deploys the app to the retype branch, the Azure SWA cannot find the app/files to build the website - and thus the errors. I plan to try and change the branch location to retype in the azure-static-web-apps-<RANDOM_NAME>.yml settings (see below from example). I did try and just change the azure-static-web-apps-<RANDOM_NAME>.yml code to the different branch - to no effect (without modifying settings in the Azure site).
However, I do not expect this to be completely successful because when Retype builds and deploys to the retype branch, the azure-static-web-apps-<RANDOM_NAME>.yml file is not included in the end result. I have attempted to force the inclusion of the azure-static-web-apps-<RANDOM_NAME>.yml through appropriate code, but with no success.
While one considering writing an answer to this question may not know of Retype, I would like any advice and assistance on the SWA and the means and process of successfully creating it. For example, is my speculation correct? Should I direct the azure-static-web-apps-<RANDOM_NAME>.yml to the retype branch through a different means? Also, any advice on
the app_ / api_ / output_location would be helpful, too (at the moment, these are being left as default ("/", "/" and "", respectively).
I am seeking assistance from the developers of Retype to attempt to find a solution from their end, as well.
Anyone that has any ideas or advice on SWA would be most appreciated.
----------
Azure SWA Build and Deploy error:
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 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.20220323.2, Commit: a7f6e2eb2eb42b5c2283d25131ef1f097480015e, ReleaseTagName: 20220323.2
Build Operation ID: |zQZrj+LLAIo=.e111cf36_
Repository Commit : 72896c909d6d80eddb2fe31a5b7c4f69b9f26b5f
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
Failed to find a default file in the app artifacts folder (/). Valid default files: index.html,Index.html.
If your application contains purely static content, please verify that the variable 'app_location' in your workflow file points to the root of your application.
If your application requires build steps, please validate that a default file exists in the build output directory.
For further information, please visit the Azure Static Web Apps documentation at https://learn.microsoft.com/en-us/azure/static-web-apps/
If you believe this behavior is unexpected, please raise a GitHub issue at https://github.com/azure/static-web-apps/issues/
Exiting
----------
azure-static-web-apps-<RANDOM_NAME>.yml example code for different branch
name: Azure Static Web Apps CI/CD
on:
push:
branches:
- retype
pull_request:
types: [opened, synchronize, reopened, closed]
branches:
- retype
----------