We have a pack of GitHub Actions that let you manage an already running JetStream Server, useful for managing releases or standing up test infrastructure.
Full details and examples are in the jetstream-gh-actions repository, here's an example.
on:pushname:ordersjobs:# First we delete the ORDERS stream and consumer if they already existclean_orders:runs-on:ubuntu-lateststeps: - name:orders_streamuses:nats-io/jetstream-gh-action/delete/stream@masterwith:missing_ok:1stream:ORDERSserver:js.example.net# Now we create the Stream and Consumers using the same configuration files the # nats CLI utility would use as shown abovecreate_orders:runs-on:ubuntu-latestneeds:clean_orderssteps: - uses:actions/checkout@master - name:orders_streamuses:nats-io/jetstream-gh-action/create/stream@masterwith:config:ORDERS.jsonserver:js.example.net - name:orders_new_consumeruses:nats-io/jetstream-gh-action/create/consumer@masterwith:config:ORDERS_NEW.jsonstream:ORDERSserver:js.example.net# We publish a message to a specific Subject, perhaps some consumer is # waiting there for it to kick off testspublish_message:runs-on:ubuntu-latestneeds:create_orderssteps: - uses:actions/checkout@master - name:orders_new_consumeruses:nats-io/jetstream-gh-action@masterwith:subject:ORDERS.deploymentmessage:Published new deployment via "${{ github.event_name }}" in "${{ github.repository }}"server:js.example.net