How to trigger a build using Github Actions from strapi webhook #6576
Replies: 5 comments 7 replies
-
|
I'm also trying to do exactly this, it seems that it's not possible. We might have to create a custom lifecycle method for every single collection type manually triggering the POST request to Github. I'm waiting on an answer too but this isn't looking hopeful. I'll update you if I make any progress |
Beta Was this translation helpful? Give feedback.
-
|
Hi! I've encountered a similar problem. Unfortunately, I didn't find it possible to add the body to the POST request, and the Github API requires this. So I decided to use Buddy. Free plan is very limited and wasn't enough for my requirements, but I used Buddy to trigger a request to Github API. Buddy is very easy to set up, because everything is clickable. To run Buddy's pipeline you don't need any information in the body of the request, so there is no problem with this in Strapi. So, my solution looks like:
|
Beta Was this translation helpful? Give feedback.
-
|
I'm new to strapi , but I think I will face the same problem. I want to know if it's easier to create a custom route in strapi, triggered by the webhook, and do the request to github actions from the custom controller. Maybe it's better than using another tool ? |
Beta Was this translation helpful? Give feedback.
-
|
@ggirodda thanks a lot for sharing your code. I will try your solution. I wonder what would be better - this custom made or something what involves 3rd party services like buddy. I hope Strapi will make it possible to add body to a webhook. |
Beta Was this translation helpful? Give feedback.
-
|
@ggirodda somehow I get I assume this should work on localhost as well. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all
I am investigating whether to use Strapi and Gatsby for an upcoming project. I haven't used Strapi before but so far it looks like an exact match for what I'm looking for!
My plan is to use Github Actions with a pipeline that runs
gatsby buildand then builds an nginx docker container with the static files and pushed that to my image registry where another system takes over. I've successfully created a pipeline that can be triggered via the github api, however, the payload when posting to the github api has to look similar towhich I don't see is possible via the Strapi Webhooks functionality.
My question is:
Is there a way to modify the payload sent by the webhook? Or is there another way to accomplish the task? I was considering creating a route in strapi that the webhook would hit and then make that route hit the github api but as I'm new to Strapi I'm not sure whether that's a bad idea :)
Beta Was this translation helpful? Give feedback.
All reactions