kafka-gh-actions-trigger
Trigger a GitHub Actions workflow from a Kafka message
Usage
-
Create a GitHub repo with a workflow like https://github.com/mheers/gh-actions-test
-
Create a GitHub token with workflow
scope.
-
Create a .env
file with the following content:
GITHUB_TOKEN=your-github-token
REPO_ORG=your-repo-org
REPO_NAME=your-repo-name
- Run the following commands:
# start Kafka
docker compose up -d
# run the app
export $(cat .env | xargs)
go run main.go
- 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