Code Monkey home page Code Monkey logo

github-deploy-action's Introduction

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

Input Required Default Description
environment true The environment where the deploy is being done.
version true The version being deployed.
status false succeeded The status of the deploy.
source_maps false JS source map files.
minified_urls false Minified URLs linked to source maps above
local_username false Username of the deploying user. Alternative to setting ROLLBAR_USERNAME

Outputs

Input Description
deploy_id The id of the deploy.

Example

steps:
  - name: Notify deploy to Rollbar
    uses: rollbar/[email protected]
    id: rollbar_deploy
    with:
      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 Rollbar
    uses: rollbar/[email protected]
    id: rollbar_pre_deploy
    with:
      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 Rollbar
    uses: rollbar/[email protected]
    id: rollbar_post_deploy
    with:
      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 maps
  build:
    - uses: actions/checkout@v2
    - name: npm run build
      run: npm run build --prefix templates/static/
    - uses: actions/upload-artifact@v2
      with:
        name: bundle.js.map
        path: public/bundle.js.map
    - uses: actions/upload-artifact@v2
      with:
        name: bundle2.js.map
        path: public/bundle2.js.map
  # This workflow deploys source maps to Rollbar
  deploy:
    needs: build
    steps:
    - uses: actions/checkout@v2
    - uses: actions/download-artifact@v2
      with:
        name: bundle.js.map
    - uses: actions/download-artifact@v2
      with:
        name: bundle2.js.map
    - name: Rollbar deploy
      uses: rollbar/[email protected]
      with:
        environment: production
        version: ${{ github.sha }}
        status: succeeded
        source_maps: bundle.js.map bundle2.js.map
        minified_urls: https://www.example.com/public/bundle.js https://www.example.com/public/bundle2.js
      env:
          ROLLBAR_ACCESS_TOKEN: ${{ secrets.ROLLBAR_ACCESS_TOKEN }}

github-deploy-action's People

Contributors

austenlacy avatar basoko avatar bxsx avatar cyrusradfar avatar fabn avatar gavinsharp avatar ijsnow avatar jackton1 avatar mani-rollbar avatar mrunalk avatar mudetroit avatar tiagogouvea 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.