Render
Render lets you easily deploy and scale full stack applications. You can deploy your Inngest functions on Render using any web framework, including Next.js, Express, and FastAPI.
Below, we'll cover how to deploy:
- A production Inngest app
- Preview apps for each of your Git development branches
Before you begin
- Create a web application that serves Inngest functions.
- Test this web app locally with the Inngest dev server.
Deploy a production app on Render
- Deploy the web application that contains your Inngest functions to Render.
- See Render's guides to learn how to deploy specific frameworks, such as:
- Set the
INNGEST_SIGNING_KEY
andINNGEST_EVENT_KEY
environment variables on your Render web app.- You can easily configure environment variables on a Render service through the Render dashboard.
- You can find your production
INNGEST_SIGNING_KEY
here, and your productionINNGEST_EVENT_KEY
s here.
- Manually sync your Render web app with Inngest.
- See this Inngest guide for instructions.
Automatically sync your app with Inngest
Each time you push changes to your Inngest functions, you need to sync your web app with Inngest. For convenience, you can automate these syncs from your CI/CD or from your API.
Automatically sync from your CI/CD
Automatically sync your app with Inngest using the Render Deploy Action, combined with a "curl command":
# .github/workflows/deploy.yaml
name: My Deploy
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Deploy to production
uses: johnbeynon/render-deploy-action@v0.0.8
with:
service-id: ${{ secrets.MY_RENDER_SERVICE_ID }}
api-key: ${{ secrets.MY_RENDER_API_KEY }}
wait-for-success: true
sync_inngest:
runs-on: ubuntu-latest
needs: build
steps:
- name: Register application to Inngest
- run: |
curl -X PUT ${{ secrets.APP_URL }}/api/inngest
The above GitHub Action requires the MY_RENDER_API_KEY
, MY_RENDER_SERVICE_ID
and APP_URL
to be configured on your repository.
Automatically sync from your app
You app can self-register as part of its startup flow if it matches the following requirements:
- Your application should run as a long-lived server instance (not serverless)
- Your application should be deployed as a single node (not with auto scaled replicas)
The following Express.js code snippet showcases how to achieve self-register:
index.ts (Express.js)
// your express `app` definition stands here...
app.listen(PORT, async () => {
console.log(`✅ Server started on localhost:${PORT}
➡️ Inngest running at http://localhost:${PORT}/api/inngest`);
// Attempt to self-register the app after deploy
if (process.env.RENDER_EXTERNAL_URL) {
console.log(
`Attempting self-register. Functions: `,
functions.map((f) => f.name).join(', ')
);
const inngestURL = new URL('/api/inngest', process.env.RENDER_EXTERNAL_URL);
const result = await fetch(inngestURL, {
method: 'PUT',
});
await sleep(2000);
try {
const json = await result.json();
console.log(
`Register attempted:`,
inngestURL.toString(),
result.status,
json
);
} catch (err) {
console.log(
`Register failed:`,
inngestURL.toString(),
result.status,
result.body
);
}
}
});
function sleep(t: number): Promise<void> {
return new Promise((res) => {
return setTimeout(res, t);
});
}
The full code is available on GitHub
Set up preview apps on Render
What are preview apps?
Render lets you deploy work-in-progress versions of your apps using code in a Git development branch. Specifically, you can deploy:
- Service previews: a temporary standalone instance of a single Render service.
- Preview environments: a disposable copy of your production environment that can include multiple services and databases.
You can use Render's service previews and preview environments together with Inngest's branch environments.
Set up Inngest in preview apps
To use Inngest in a Render service preview or preview environment, follow these steps.
One-time setup:
- Follow Render's guides to enable either a service preview or a preview environment.
- In Inngest, create a branch environment
INNGEST_SIGNING_KEY
and a branch environmentINNGEST_EVENT_KEY
.
Each time a preview app is deployed:
-
Set the following environment variables on the preview service:
INNGEST_SIGNING_KEY
andINNGEST_EVENT_KEY
: Use the values from your Inngest branch environment.INNGEST_ENV
: Provide any value you want. This value will be used as the name of the branch in Inngest. As an option, you can use the value ofRENDER_GIT_BRANCH
.
You can configure environment variables on the preview service through the Render dashboard. Alternatively, you can send a
PUT
orPATCH
request via the Render API. -
Sync the app with Inngest.
You can manually sync the app from the branch environments section of your Inngest dashboard, or automatically sync your app using a strategy described above.