Git Product home page Git Product logo

heroku-review-app-actions's Introduction

GitHub Action - Manage Heroku Review Apps

This GitHub action manages Heroku review apps for your software delivery pipeline. This was born out of the frustration of not being able to use review apps for a long time and there's no timeline when Heroku will have this sorted. See status.heroku.com/incidents/2413 for more info.

This mimics ๐Ÿ’ฏ how review apps work with the native Heroku integration.

Features

  • โš™๏ธ Focuses on automated preview deploy. You get the same automated preview deploy experience for your PRs.
  • ๐ŸŽ Fast . No need to upload all your git info/metadata or history to Heroku.(coming soon - configure which files to omit from source code upload).
  • ๐Ÿง˜๐Ÿฝโ€โ™€๏ธ No fear of 3rd party having access to all your private GitHub data/repository.

How To Use

Here's an example workflow that uses this action. This example workflow runs when you open (reopen), close, or push a new commit to your PR branch.

This action delete review apps when the associating PR is closed.

on:
  pull_request:
    types: [opened, reopened, closed, synchronize]

jobs:
  automate-review-app:
    runs-on: ubuntu-latest
    name: A job to create and delete review a review app
    steps:
      - name: Checkout
        uses: actions/checkout@v3
      - name: Deploy Heroku app
        uses: pmbanugo/[email protected] # Uses the action
        id: deploy
        with:
          api-key: ${{ secrets.HEROKU_API_KEY }}
          pipeline-id: ${{ secrets.HEROKU_PIPELINE_ID }}
          app-name-prefix: getting-started
          region: us
          use-app-json: true # Use this if your app contains app.json in the root directory
      - name: Get the review app url # Use the output from the `deploy` step
        run: echo "The URL is ${{ steps.deploy.outputs.url }}"
      - name: Comment on commit # Optional: You can use any action to comment on the PR
        uses: phulsechinmay/[email protected]
        with:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          COMMENT_IDENTIFIER: "Deploy"
          message: |
            I deployed a review app for you to try out this pull request ๐Ÿ‘‡๐Ÿฝ

            Heroku App: ${{ steps.deploy.outputs.url }}

The action expects a few input parameters which are defined below.

  • app-name-prefix (optional): Prefix for the app. This is should generally be the name of the pipeline e.g airtable prefix will produce soludo-pr-PR_NUMBER.herokuapp.com.
  • api-key (required): Your Heroku API key
  • pipeline-id (required): The id of the pipeline to deploy the review app to.
  • region (optional): The region to deploy to. For example eu or us. Default: eu
  • stack (optional): The Heroku stack to deploy and build with e.g heroku-18. Default: heroku-20. If the input use-app-json is true, the stack will be determined by what's in app.json, and if not present, the default on Heroku will be used.
  • use-app-json (optional): Set up the initial build using the app.json in the root directory. Default: false.

What's next?

I used a similar code for my private workflow since the removal of GitHub integration from Heroku. I decided to release this seeing that there's no clear indication as to when it'll be sorted. There are some edge cases that should be handled (proper error handling) but at the current release is not being done. I'll be making improvements in the coming days/weeks until Heroku restores their service (or until the community no longer needs this).

This action works well with most cases at the moment. If something is broken or you would extra features or configuration, feel free to create an issue.

Sponsor

To better support the maintenance and active development of this projects (as well as others), it'll be helpful if you sponsor me here on GitHub.

Contributing

You're welcome to submit PR to fix a bug or propose a feature. When you send a PR, pls point it to the dev branch

heroku-review-app-actions's People

Contributors

pmbanugo avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.