Open jennyxchengsea opened 3 years ago
Hi @jennyxchengsea, after binding your GitHub repository to Static Web Apps, you should have a GitHub Actions workflow defined at .github/workflows/xxxxx.yaml
.
Within the file, app_location
points to your web app sources live and api_location
points to where your web app api sources live. If your app_location
points to a folder with some static html/css, and no special build steps are needed, you can skip the build step completely (by adding skip_app_build: true
right below that line).
More details can be found in the documentation.
I had the same issue when using the Azure DevOps Task AzureStaticWebApp@0
.
You can fix the issue there by using the undocumented cwd
(current working directory) input parameter:
- task: AzureStaticWebApp@0
inputs:
cwd: $(Pipeline.Workspace)/${{parameters.artifact}}
app_location: ${{parameters.distDirectory}}
azure_static_web_apps_api_token: ${{parameters.azureStaticWebAppsApiToken}}
@JoCa96 How did you find out about the cwd
input parameter? How likely is it to be removed in future versions?
cwd
should appear in the Azure DevOps UX if you use it to edit your tasks.
We missed adding it to the docs. We'll work on that.
I've tried to deploy the static web app via github, and I received this error.
App Directory Location: '/app' is invalid. Could not detect this directory. Please verify your workflow reflects your repository structure.
For further information, please visit the Azure Static Web Apps documentation at https://docs.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
I believe it has something to do with setting on repositoryToken and appLocation
How do I find these info via my github repository?