Skip to content

Instantly share code, notes, and snippets.

View michalfita's full-sized avatar
🛠️
Rust Tinkering

Michał Fita michalfita

🛠️
Rust Tinkering
View GitHub Profile
@lemiorhan
lemiorhan / post-receive
Last active February 8, 2023 10:06
Post-receive hook to deploy the code being pushed to production branch to a specific folder
#!/bin/bash
target_branch="production"
working_tree="PATH_TO_DEPLOY"
while read oldrev newrev refname
do
branch=$(git rev-parse --symbolic --abbrev-ref $refname)
if [ -n "$branch" ] && [ "$target_branch" == "$branch" ]; then