Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

46 Commits

Repository files navigation

GitHub deploy action

CI

A GitHub action that notifies deploys to Rollbar.

Usage

This action requires that you set the ROLLBAR_ACCESS_TOKEN environment variable with a token that must have the post_server_item scope. You can find it under your project's settings in the Project access token section.

When notifiying deploys in two stages, for sending to Rollbar when a deploy starts and the status of its result (succeeded or failed ) you need also to set the DEPLOY_ID environment variable with the ouput of the previous step.

Optionally set ROLLBAR_USERNAME environment variable, usernames can be found at:

https://rollbar.com/settings/accounts/YOUR_TEAM/members/

NOTE: When using github.actor as the ROLLBAR_USERNAME ensure the username in Rollbar matches your GitHub username. If your Rollbar usernames don't match GitHub usernames, you may want to instead set the local_username input.

Inputs

InputRequiredDefaultDescription
environmenttrueThe environment where the deploy is being done.
versiontrueThe version being deployed.
statusfalsesucceededThe status of the deploy.
source_mapsfalseJS source map files.
minified_urlsfalseMinified URLs linked to source maps above
local_usernamefalseUsername of the deploying user. Alternative to setting ROLLBAR_USERNAME

Outputs

InputDescription
deploy_idThe id of the deploy.

Example

steps:
- name: Notify deploy to Rollbaruses: rollbar/github-deploy-action@2.1.2id: rollbar_deploywith:
environment: 'production'version: ${{ github.sha }}env:
ROLLBAR_ACCESS_TOKEN: ${{ secrets.ROLLBAR_ACCESS_TOKEN }}ROLLBAR_USERNAME: ${{ github.actor }}

Example with deploy update

steps:
- name: Notify start deploy to Rollbaruses: rollbar/github-deploy-action@2.1.2id: rollbar_pre_deploywith:
environment: 'production'version: ${{ github.sha }}status: 'started'env:
ROLLBAR_ACCESS_TOKEN: ${{ secrets.ROLLBAR_ACCESS_TOKEN }}ROLLBAR_USERNAME: ${{ github.actor }}
...
steps:
- name: Notify finish deploy to Rollbaruses: rollbar/github-deploy-action@2.1.2id: rollbar_post_deploywith:
environment: 'production'version: ${{ github.sha }}status: 'succeeded'env:
ROLLBAR_ACCESS_TOKEN: ${{ secrets.ROLLBAR_ACCESS_TOKEN }}ROLLBAR_USERNAME: ${{ github.actor }}DEPLOY_ID: ${{ steps.rollbar_pre_deploy.outputs.deploy_id }}

Example with JS Source Map

jobs:
# This workflow builds source mapsbuild:
- uses: actions/checkout@v2
- name: npm run buildrun: npm run build --prefix templates/static/
- uses: actions/upload-artifact@v2with:
name: bundle.js.mappath: public/bundle.js.map
- uses: actions/upload-artifact@v2with:
name: bundle2.js.mappath: public/bundle2.js.map# This workflow deploys source maps to Rollbardeploy:
needs: buildsteps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v2with:
name: bundle.js.map
- uses: actions/download-artifact@v2with:
name: bundle2.js.map
- name: Rollbar deployuses: rollbar/github-deploy-action@2.1.2with:
environment: productionversion: ${{ github.sha }}status: succeededsource_maps: bundle.js.map bundle2.js.mapminified_urls: https://www.example.com/public/bundle.js https://www.example.com/public/bundle2.jsenv:
ROLLBAR_ACCESS_TOKEN: ${{ secrets.ROLLBAR_ACCESS_TOKEN }}

About

Github action to notify deploys to Rollbar

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages