Skip to content

JorgeLNJunior/render-deploy

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

CI Coverage Status License GitHub Release

Table of Contents

Introduction

This GitHub Action simplifies the deployment process to Render. It allows you to trigger deployments automatically on pushes, pull requests, or scheduled workflows.

Usage

Prerequisites

  1. Disable Auto-Deploy: In your Render app settings, go to Settings > Build and Deploy > Auto-Deploy and disable it. This action will handle deployments.
  2. Set Secrets: In your repository's Settings > Secrets and Variables > Actions, create the following secrets:
    • RENDER_SERVICE_ID: Your Render service ID (found in the service URL).
    • RENDER_API_KEY: Your Render API key (generated in your Render Account Settings > API Keys).
  3. (Optional) GitHub Token: If using github_deployment: true, you'll need the GITHUB_TOKEN secret (automatically provided by GitHub Actions). Ensure your workflow has the deployments: write permission.

Minimal Example

deploy:
  runs-on: ubuntu-latest
  steps:
    - uses: actions/checkout@v4
    - uses: JorgeLNJunior/render-deploy@v1.4.5
      with:
        service_id: ${{ secrets.RENDER_SERVICE_ID }}
        api_key: ${{ secrets.RENDER_API_KEY }}

Waiting for Deployment Status

deploy:
  runs-on: ubuntu-latest
  steps:
    - uses: actions/checkout@v4
    - uses: JorgeLNJunior/render-deploy@v1.4.5
      with:
        service_id: ${{ secrets.RENDER_SERVICE_ID }}
        api_key: ${{ secrets.RENDER_API_KEY }}
        wait_deploy: true

Creating a GitHub Deployment

deploy:
  runs-on: ubuntu-latest
  permissions:
    deployments: write
  steps:
    - uses: actions/checkout@v4
    - uses: JorgeLNJunior/render-deploy@v1.4.5
      with:
        service_id: ${{ secrets.RENDER_SERVICE_ID }}
        api_key: ${{ secrets.RENDER_API_KEY }}
        github_deployment: true
        deployment_environment: 'production' # e.g., production, staging
        github_token: ${{ secrets.GITHUB_TOKEN }}

Full Example

deploy:
  runs-on: ubuntu-latest
  permissions:
    deployments: write
  steps:
    - uses: actions/checkout@v4
    - uses: JorgeLNJunior/render-deploy@v1.4.5
      with:
        service_id: ${{ secrets.RENDER_SERVICE_ID }}
        api_key: ${{ secrets.RENDER_API_KEY }}
        clear_cache: true # Optional: Clear Render's build cache
        wait_deploy: true
        github_deployment: true
        deployment_environment: 'production'
        github_token: ${{ secrets.GITHUB_TOKEN }}

Inputs

Input Description Required Default
service_id The ID of your Render service. Yes
api_key Your Render API key. Yes
clear_cache Whether to clear Render's build cache before deploying. No false
wait_deploy Whether to wait for the deployment to finish before the action completes. No false
github_deployment Whether to create a GitHub deployment status. No false
deployment_environment The name of the deployment environment (e.g., 'production', 'staging'). Required if github_deployment is true. No production
github_token The GitHub token. Required if github_deployment is true. Use ${{ secrets.GITHUB_TOKEN }}. No

License

Project under MIT License.