GithubHelp home page GithubHelp logo

isabella232 / jetstream-gh-action Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nats-io/jetstream-gh-action

0.0 0.0 0.0 92 KB

Collection of JetStream related Actions for GitHub Actions

License: Apache License 2.0

Dockerfile 0.65% Go 99.35%

jetstream-gh-action's Introduction

NATS JetStream GitHub Action Pack

This is a collection of GitHub Actions to interact with NATS JetStream.

Action Description
nats-io/jetstream-gh-action/validate/stream@master Validates Stream Configuration
nats-io/jetstream-gh-action/validate/consumer@master Validates Consumer Configuration
nats-io/jetstream-gh-action/create/stream@master Creates Streams
nats-io/jetstream-gh-action/create/consumer@master Creates Consumers
nats-io/jetstream-gh-action/update/stream@master Updates Streams
nats-io/jetstream-gh-action/delete/stream@master Deletes Streams
nats-io/jetstream-gh-action/delete/consumer@master Deletes Consumers
nats-io/jetstream-gh-action/eval/stream@master Evaluate Stream state
nats-io/jetstream-gh-action/eval/consumer@master Evaluate Consumer state
nats-io/jetstream-gh-action/purge/stream@master Purge all data from a Stream
nats-io/jetstream-gh-action@master Publish to a JetStream Stream

See individual action directory for detailed usage instructions.

JetStream Service In Workflow

JetStream can be run within the workflow job as a local service, here's an example starting the Service and creating a Stream in it.

on: push
name: orders
jobs:
  orders:
    runs-on: ubuntu-latest
    services:
      # starts a JetStream service locally known as "jetstream" on the network
      jetstream:
        image: synadia/jsm:latest
        options: >-
          -e JSM_MODE=server

      # creates a stream on the "jetstream:4222" server started above
      - name: orders_stream
        uses: nats-io/jetstream-gh-action/create/stream@master
        with:
          config: ORDERS.json
          server: jetstream:4222

This server is available to all steps in the job that hosts it.

Publishing Messages

Messages can be published to a Stream, or any NATS subject, using the base action.

Usage

on: push
name: consumer
jobs:
  consumer_validate:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@master
      - name: hello
        uses: nats-io/jetstream-gh-action@master
        with:
          subject: ORDERS.deploy
          message: Published new deployment via "${{ github.event_name }}" in "${{ github.repository }}"
          should_ack: 1
          server: nats.example.net:4222

Inputs

Input Description
subject The subject to publish to (required)
message The message payload (required)
should_ack If a positive response from JetStream is required for success
server Comma separated list of NATS Server URLs (required)
username Username or Token to connect with
password Password to connect with
credentials Path to a file holding NATS credentials

Outputs

Output Description
response Response received or error body

jetstream-gh-action's People

Contributors

ripienaar 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.