Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
check-circle

GitHub Action

Action GitHub Deployment

v2.0.0

Action GitHub Deployment

check-circle

Action GitHub Deployment

:octocat: Reflect CD as GitHub Deployment

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Action GitHub Deployment

uses: ReasonSoftware/[email protected]

Learn more about this action in ReasonSoftware/action-github-deployment

Choose a version

action-github-deployment

Release Go Report Card Docker Pulls License

A GitHub Action for a creation and status update of a GitHub Deployment during CD flow

Features

  • Easily create GitHub Deployments
  • Update status of an existing deployments
  • Custom GitHub Environments supported
  • Incredibly fast! About 2MB docker image

Manual

Just to add an action to your CD flow

    - name: Create Deployment
      uses: docker://reasonsoftware/action-github-deployment:v1
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ℹ️ Create a deployment and later update its status
    - name: Create Deployment
      id: deployment
      uses: docker://reasonsoftware/action-github-deployment:v1
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    
    [...]

    - name: Update Status
      uses: docker://reasonsoftware/action-github-deployment:v1
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        DEPLOYMENT: ${{steps.deployment.outputs.id}}
        STATUS: success

You may also update the deployment to either success or failure in one step by providing an overall status as FAIL environmental variable:

    [...]

    - name: Update Status
      uses: docker://reasonsoftware/action-github-deployment:v1
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        DEPLOYMENT: ${{steps.deployment.outputs.id}}
        STATUS: success
        FAIL: "${{ failure() }}"
ℹ️ Create a deployment with non-default status
    - name: Create Deployment
      uses: docker://reasonsoftware/action-github-deployment:v1
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        STATUS: in_progress

Configuration

  • DEPLOYMENT - existing deployment ID, required when updating status
  • STATUS - status of a deployment, must be one of the following: [ error, failure, inactive, in_progress, queued, pending, success ]
  • ENVIRONMENT - GitHub Environment, default production
  • FAIL: failure trap which will tweak the status to be failure on value "true". Used to reduce overal workflow code by configuring one action for both successful or failed deployments with FAIL: "${{ failure() }}"

Notes

  • This action is automatically built at Docker Hub, and tagged with latest / v1 / v1.2 / v1.2.3 allowing to lock against a certain version It's recommended to lock against a major version, for example v1
  • Docker image is published both to Docker Hub and GitHub Packages. If you don't want to rely on Docker Hub but still want to use the dockerized action, you may switch from uses: docker://reasonsoftware/action-github-deployment:v1 to uses: docker://docker.pkg.github.com/reasonsoftware/action-github-deployment/action-github-deployment:v1

License

Apache-2.0 © 2021 Reason Cybersecurity Ltd.