Continous deployment...

This Bash script .git/hooks/post-merge runs my deploy command every time I merge something in the deployment branch.

#!/bin/bash

set -x 

# Define the name of the deployment branch
deployment_branch="deployment"

# Get the name of the current Git branch
current_branch=$(git rev-parse --abbrev-ref HEAD)

# Check if the current branch matches the deployment branch
if [[ "$current_branch" == "$deployment_branch" ]]; then
  git log --oneline -n 1
  npm run build:deploy
fi

:)

favicon vanhalt.com

© 2025 Aria template by https://x.com/xkaibi

𝕏 GitHub