kafka-gh-actions-trigger

command module
v0.0.0-...-0853f0f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 18, 2024 License: MIT Imports: 8 Imported by: 0

README

kafka-gh-actions-trigger

Trigger a GitHub Actions workflow from a Kafka message

Usage

  1. Create a GitHub repo with a workflow like https://github.com/mheers/gh-actions-test

  2. Create a GitHub token with workflow scope.

  3. Create a .env file with the following content:

GITHUB_TOKEN=your-github-token
REPO_ORG=your-repo-org
REPO_NAME=your-repo-name
  1. Run the following commands:
# start Kafka
docker compose up -d

# run the app
export $(cat .env | xargs)
go run main.go
  1. Produce a message to the gh-actions-trigger topic:
docker compose exec kafka kafka-console-producer --topic gh-actions-trigger --bootstrap-server localhost:29092

When you produce a message, the GitHub Actions workflow will be triggered.

Build

cd ci/

export $(cat .env | xargs)
dagger call build-and-push-image --src ../ --registry-token=env:REGISTRY_ACCESS_TOKEN

TODO

  • GH Actions trigger
  • Kafka konsumer

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL