Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/max-lt/github-hook
Server that execute CI script when called from Github.
https://github.com/max-lt/github-hook
continuous-deployment continuous-integration github github-api
Last synced: 24 days ago
JSON representation
Server that execute CI script when called from Github.
- Host: GitHub
- URL: https://github.com/max-lt/github-hook
- Owner: max-lt
- Archived: true
- Created: 2019-05-02T14:17:34.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-03-07T10:43:47.000Z (8 months ago)
- Last Synced: 2024-07-29T17:44:10.850Z (4 months ago)
- Topics: continuous-deployment, continuous-integration, github, github-api
- Language: JavaScript
- Homepage:
- Size: 41 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Github hook server
This repository will be archived as it has been rewritten is rust! [Check it out](https://github.com/max-lt/github-hook-rs)
## Install
Copy / fork source somewhere (for example in `/opt/github-hook`).
Create '/etc/systemd/system/github-hook.service'
```
[Unit]
Description=Github Webhook Server
After=network.target[Service]
ExecStart=/usr/bin/node /opt/github-hook/src/index.js
# Required on some systems
#WorkingDirectory=/opt/nodeserver
Restart=always
# Restart service after 10 seconds if node service crashes
RestartSec=10
# Output to syslog
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=github-hook
#User=
#Group=
Environment=NODE_ENV=production PORT=8080 CONFIG=/home/me/my-config.yml[Install]
WantedBy=multi-user.target
```## Start
```
systemctl start github-hook
```## Example of config file
```yml
repositories:
project1:
secret: project1secret
script: /some/path/script.sh
project2:
secret: project2secret
script: /another/path/script.sh --some-argument
project3:
secret: project1secret
script: /some/path/script.sh
branch: master # optional
```# Configure your github project:
> Note that this is an example for the "project1" repository.
Go into your project's settings > webhooks
Set `Payload URL` to `http://example.com:8080/github-hook/project1`
Set `Content type` to `application/json`
Set `Secret` to `project1secret`