Skip to content

RyuaNerin/ghpull

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ghpull

Auto git-pull by GitHub WebHook

깃허브 웹훅을 활용하여, 레포지토리 업데이트 시 Git pull 수행하기

Installation

  • Environment in this case
    Description Value
    GitHub Repository https://github.com/RyuaNerin/portfolio
    GitHub WebHook Payload URL https://ryuar.in/__push
    GitHub WebHook Secret 1234567890
    Local Repository Directory /srv/http/ryuar.in/_default
    HTTP Server Binding tcp :8081
  1. Config Github Actions

    1. Repository Page -> Settings -> Webhooks
    2. Click Add webhook
    3. Input https://ryuar.in/__push in Payload URL
    4. Input 1234567890 in Secret
    5. Select Just the push event.
    6. Click Add Webhook.
  2. Clone target repository.

    > git clone https://github.com/RyuaNerin/portfolio -o /srv/http/ryuar.in/_default
  3. Clone this repository, then build package

    > git clone https://github.com/RyuaNerin/ghpull.git
    > cd ghpull
    > go build -v
  4. Copy binary.

    > sudo cp ghpull /usr/local/bin/ghpull
  5. Edit Nginx Configure.

    > sudo vi /etc/nginx/conf.d/ryuar.in.conf
    location /__push {
        proxy_pass http://unix:/run/ghpull/ryuar.in.sock;
    }
  6. Run ghpull and test.

    > sudo -u ghpull /usr/local/bin/ghpull -unix "/run/ghpull/ryuar.in.sock" -path "/__push" -dir "/srv/http/ryuar.in/_default" -secret "1234567890"
  7. To Use systemd.

    > sudo cp ghpull.service /etc/systemd/system/
    > sudo vim /etc/systemd/system/ghpull.service
    > sudo systemctl enable ghpull.service
    > sudo systemctl start ghpull.service

About

Auto git-pull by GitHub WebHook

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Languages