{"id":18926085,"url":"https://github.com/getpagespeed/githook","last_synced_at":"2025-07-14T06:37:40.345Z","repository":{"id":134154150,"uuid":"96041682","full_name":"GetPageSpeed/GitHook","owner":"GetPageSpeed","description":null,"archived":false,"fork":false,"pushed_at":"2017-07-02T18:34:25.000Z","size":3,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-31T18:30:25.135Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GetPageSpeed.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-07-02T18:29:18.000Z","updated_at":"2017-07-02T18:34:26.000Z","dependencies_parsed_at":null,"dependency_job_id":"b0c80dea-ef18-4711-b913-3b022215c7ff","html_url":"https://github.com/GetPageSpeed/GitHook","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GetPageSpeed%2FGitHook","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GetPageSpeed%2FGitHook/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GetPageSpeed%2FGitHook/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GetPageSpeed%2FGitHook/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GetPageSpeed","download_url":"https://codeload.github.com/GetPageSpeed/GitHook/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239921837,"owners_count":19718844,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T11:14:29.831Z","updated_at":"2025-02-20T22:19:12.242Z","avatar_url":"https://github.com/GetPageSpeed.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GitHook\n\nEasy deployment to LEMP servers using GitHub or BitBucket web hooks. \nGitHook will update your website and clear cache automatically. It will also send email upon deployment!\n\n# Features\n\nThe following is what GitHook does for you when you push files to your site through Git:\n\n* Updates your Git based website using ```git pull```.\n* Clears website cache for known website types. Supports clearing cache upon deployment for Magento 1 and Wordpress.\n* Clears Varnish cache for the website if you told it to.\n* Clears PHP opcache and realstat cache so that you can run your server with best TTL settings for performance.\n\n# Installation\n\n1. Add it as Git submodule to your project. \n\n```git submodule add git://github.com/chneukirchen/rack.git rack.```\n\n\n2. Configure Nginx to pass appropriate variables to the GitHook.\n\n```\nserver {\n    # your usual yada-yada website configuration goes here\n    \n    location /GitHook/ {\n        fastcgi_param GIT_WEBSITE_TYPE magento1;\n        fastcgi_param GIT_USES_VARNISH 1;\n        fastcgi_param GIT_HOOK_SECRET XXXXX;\n        fastcgi_param GIT_HOOK_PROJECT_NAME MyProject;\n        fastcgi_param GIT_HOOK_BRANCH staging;\n        fastcgi_param GIT_HOOK_EMAILS dev@example.com;\n        fastcgi_param GIT_HOOK_SLACK_TOKEN BLAHBLAH;\n        fastcgi_param GIT_HOOK_SLACK_CHANNEL server;\n        fastcgi_pass unix:/var/run/php-fpm/php-fpm-example.com.sock;\n        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;\n        include fastcgi_params;\n    }\n}\n```  \n\nConfiguration directives are as follows:\n\n* GIT_WEBSITE_TYPE: can be one of magento1 or wordpress. Will use appropriate command line utility for clering application cache.\nE.g. for Magento 1, n98-magerun is being used to flush cache\n\n* GIT_USES_VARNISH: 0 or 1. Indicates whether we want GitHook to send BAN request for complete website.\n\n* GIT_HOOK_SECRET: should be your secret token. It is something you make up to secure your communication between GitHub and the hook.\n\n* GIT_HOOK_PROJECT_NAME: project name, that will be used in the deployment emails\n\n* GIT_HOOK_BRANCH: branch name. This is typically the branch name that your want GitHook to work with. You might want to have different GIT_HOOK_BRANCH if you have two servers (staging and master) and two hooks for the same.\n\n* GIT_HOOK_EMAILS: a comma separated list of email addresses where notification about deployment will be sent.\n\n3. Configure the web hook using GitHub or Bitbucket UI:\n\n  * Specify the same secret code as previous step\n  * Put the proper URL to GitHook's ```fire.php```, \n  i.e.: ```https://www.example.com/GitHook/fire.php```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgetpagespeed%2Fgithook","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgetpagespeed%2Fgithook","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgetpagespeed%2Fgithook/lists"}