Render preview apps triggered from Github actions

Hello community,

I’m looking at an option wherein I can trigger Render preview apps from GitHub actions to optimise the deployments to be available when needed. As I understand we have the option to set preview expiry, but then I don’t see an option to have it redeployed again from the repo.

It’d be great if there is an existing action (was not able to find one) which can help me trigger creation/destroy of previews on the basis of a GitHub comment or label on the PR. Please advice!

Hey Akshay,
So I wanted to double-check the behaviour here that we’d expect - the consensus internally is that a new push to the PR would trigger the preview environment to be recreated if it had already expired,

Regards,

John B

Hey John,
Thank you for the reply. We are using it for an open-source project called ToolJet wherein we get a lot of PRs from the community. Although render solves for deployments within the repo, we need to be able to trigger deployments for forks and otherwise. Also have the means to control the bills accumulated since some PRs after testing can have its deployments deleted right away.

Currently, we are making use of the paid plan and had migrated to this platform from Heroku. Liked the product so far. But this issue of not having a deployment flexibility is limiting. Can deployments through actions be triggered from Render APIs?

Hi there,

You can certainly trigger a deploy of a service via our API as we document at https://api-docs.render.com/reference/create-deploy.

What we don’t have (yet) is the ability to trigger a deployment of a preview environment but it’s certainly something I would very much like us to have

John B

Hey John,

I have made it work with Render API using github actions with labels.

Is there a roadmap or so wherein I can check updates in render APIs? As of now, only deploying web services are supported. I would need the ability to other services such as Postgres, Redis etc through API. Something like docker-compose based deploys will really help.

Also, is there a plan to setup GitHub actions for the API in the roadmap? Else I can help to create one and open-source it.

Not sure if this was what you meant, but have you seen this repo/action?

Yes, I have. That action helps to deploy for existing service.

What I want is similar PR preview environment ie. it can be controlled from the repo based on some trigger:

  1. Create new service which gets auto synced on new pushes to PR
  2. Suspend service when not in use
  3. Resume service when to be used.
  4. Delete service when PR is closed or based on a trigger.

So basically a wrapper around render APIs which makes them possible:

  1. Create service
  2. Suspend service
  3. Resume service
  4. Delete service

ah gotcha. That would be nice to have :slight_smile:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.