Skip to content

Instantly share code, notes, and snippets.

@warmansuganda
warmansuganda / post-receive
Created September 23, 2020 07:59
NOTE : Move the following lines to the top of .bashrc if yarn, npm or node these command not found
#!/bin/bash
TARGET="/home/server/apps/pit-service"
GIT_DIR="/home/server/repos/pit-service.git"
BRANCH="master"
while read oldrev newrev ref
do
# only checking out the master (or whatever branch you would like to deploy)
if [ "$ref" = "refs/heads/$BRANCH" ];
then
@warmansuganda
warmansuganda / git-deployment.md
Created September 12, 2018 04:52 — forked from noelboss/git-deployment.md
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your lokal GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like my Deepl.io to act upon a Web-Hook that's triggered that service.