Skip to content
Compare
Choose a tag to compare
@GrantBirki GrantBirki released this 16 Mar 21:28
· 852 commits to main since this release
fafc3d0

v5.1.0

Introducing environment_urls with deployments! 🚀

This pull request adds a new Action's input option called environment_urls. The input option is a mapping of "environments" -> "environment urls" that can be deployed.

Configuration

Explanation for the formatting of this new input option

This input option is a mapping of environment names to URLs and the environment names must match the environment_targets input option. This option is a comma separated list with pipes (|) separating the environment from the URL.

Note: disabled is a special keyword to disable an environment url if you enable this option but not all environments have a url.

Format: "<environment1>|<url1>,<environment2>|<url2>,etc"

Example: "production|https://myapp.com,development|https://dev.myapp.com,staging|disabled"

This option is especially useful when your deployment targets are services with a URL (website, API, etc)

By enabling this option, you will get a "clickable" link on success (non-noop) deployment messages on pull requests. You will also be able to click the "View deployment" button in your repository's deployments page and be taken to the URL of the environment you deployed to.

If you wish to disable the "clickable" link on the successful deloyment message, you can set the environment_url_in_comment input to "false".

Example Usage

If running this Action deploys a website called example.com and that deployment is run with .deploy to production, then you can setup the following mapping with this new input option like so:

- name: branch-deploy
  id: branch-deploy
  uses: github/[email protected]
  with:
    trigger: ".deploy"
    environment: "production"
    environment_targets: "production,development,staging"
    environment_urls: "production|https://example.com,development|https://dev.example.com,staging|stg.example.com"
    environment_url_in_comment: "true"

By setting up this Action, you can get "View deployment" buttons on your environment page that allow you view the URL associated with your deployment

Screenshot 2023-03-16 at 3 59 49 PM

Additionally, if a matching environment url is found for an environment and the deployment is not a noop deploy, the URL with a clickable link will be appended to the bottom of a successful deployment message:

Screenshot 2023-03-16 at 4 34 05 PM


What's Changed

Full Changelog: v5.0.0...v5.1.0