Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Describe Git deployment approach #304

Open
denisdefreyne opened this issue Dec 5, 2024 · 1 comment
Open

Describe Git deployment approach #304

denisdefreyne opened this issue Dec 5, 2024 · 1 comment

Comments

@denisdefreyne
Copy link
Member

See https://ecoconsulting.co.uk/solutions/#deploy-a-website-to-a-server-using-git

Or the (very similar) setup I have for my own web site. web/denisdefreyne.com.git/hooks/post-receive:

#!/bin/bash

set -ex

TARGET="/var/www/virtual/defreyne/denisdefreyne.com"
GIT_DIR="/home/defreyne/web/denisdefreyne.com.git"

BRANCH="built"

while read oldrev newrev ref
do
        if [ "$ref" = "refs/heads/$BRANCH" ];
        then
                echo "Ref $ref received. Deploying ${BRANCH} branch on server..."
                git --work-tree="${TARGET}" --git-dir="${GIT_DIR}" checkout -f ${BRANCH}
        else
                echo "Ref $ref received. Doing nothing: only the ${BRANCH} branch may be deployed on this server."
        fi
done
@DaveEveritt
Copy link

DaveEveritt commented Dec 5, 2024

I updated my "from scratch" guide at the link above, but it might be too much to add to the Nanoc site? Still, happy to have the link there. Also happy to sanitise your info and do the update next week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants