Static-web-apps: JAMstack with Headless CMS is not supported

Created on 30 May 2020  路  11Comments  路  Source: Azure/static-web-apps

In the JAMstack build workflow, it is not possible to get dynamic content from an external API and generate a static site.

Specifically, if I set the repository_dispatch as the trigger for GitHub Actions, Azure/[email protected] will fail as shown in the screenshot. It's probably a JSON payload issue.

image

A typical scenario for JAMstack is to access an online Headless CMS like Contentful in the build workflow to generate static content.

Currently, Azure Static Web Apps doesn't exactly support JAMstack; GitHub Push or PR-based content updates are called SSG (Static Site Generate) rather than JAMstack.

Most helpful comment

I have the same issue. When I trigger the GitHub Action workflow with the repository_dispatch event, it gets the error like the screenshot above. Both push and pull_request events are fine.

image

All 11 comments

Are you able to provide a GitHub repo as an example?

The repo that have validated this Issue is here,

During Nuxt.js generate, it gets dynamic contents from Contentful API and generates static files.
As you can see in the workflow history below, it succeeds on the commit trigger, but fails on the repository dispatch(webhook) trigger.

Thank @k-miyake

@k-miyake I'll take a look at this, thanks for reporting it!

I have the same issue. When I trigger the GitHub Action workflow with the repository_dispatch event, it gets the error like the screenshot above. Both push and pull_request events are fine.

image

Yes this is a bug. The Build and Deploy Github Action looks for some event data provided by Github, but I believe the repository dispatch event does not provide this. We are working on removing this dependency but it will take some time. For now we can make this error clearer until we have the proper support in place.

@miwebst Hopefully this will be fixed as soon as possible. If it's going to take a long time, it's better to note it in the documentation FAQ.

@miwebst Thank you!

Many use cases rely on the repository_dispatch event such as manual deployment, scheduled deployment that is not covered by the schedule event, or approval process using the other approach - ChatOps or GitOps.

It would be great if this bug gets fixed sooner rather than later.

I'm also having the same problem with my Blazor app. Would much appreciate for the fix. 馃檹馃徏 This is one of the huge benefits I like about Azure Static Web App.

This should be fixed now, please let us know if you continue to run into this issue!

@miwebst
The repository_dispatch trigger makes it possible for me to build and deploy successfully has been checked.
Here's the GitHub Actions log.
https://github.com/k-miyake/vacd-jamstack/runs/775400365?check_suite_focus=true

Thanks for the quick fix. Great job!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

marxxxx picture marxxxx  路  4Comments

thomastvedt picture thomastvedt  路  5Comments

rajyraman picture rajyraman  路  5Comments

henryjcee picture henryjcee  路  5Comments

JoeWirtley picture JoeWirtley  路  5Comments