https://github.com/setnemo/autodeploy-webhooks-github-via-php
A small script to automatically deploy a web project from github. Called when merging a commit
https://github.com/setnemo/autodeploy-webhooks-github-via-php
autodeploy deploy github php webhook
Last synced: 5 months ago
JSON representation
A small script to automatically deploy a web project from github. Called when merging a commit
- Host: GitHub
- URL: https://github.com/setnemo/autodeploy-webhooks-github-via-php
- Owner: setnemo
- Created: 2019-02-09T22:37:18.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2019-02-09T23:39:17.000Z (about 7 years ago)
- Last Synced: 2025-06-10T16:58:22.746Z (10 months ago)
- Topics: autodeploy, deploy, github, php, webhook
- Language: PHP
- Size: 4.88 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Deploy automation via webhooks from Github
## Add webhook
Open 'Webhooks' in repo settings and add new webhook, where Payload URL is `example.com/listener.php`. Choose 'Content type
': `application/json`
## Add 2 subdomains
Where alpha.example.com to alpha-testing, and beta.example.com for beta-testing.
## Create 2 additional branches
Where alpha branch for alpha.example.com, and beta branch for beta.example.com.
## Check path to subdomains directory and branch names
Example deploy file (running in listener.php):
```$xslt
cd example.com // cd to dir with website
git fetch origin master // fetching
git reset --hard origin/master // reset to last commit
chown -R www-data:www-data . // your web-app user from nginx or apache2 settings
git checkout master // switch to last version on branch
```
## Deploy
After push action with message 'Merge pull...' in tracking branch deploy start automatically.
## Enjoy!