Halloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix NowHalloween DealsAmazon USOctober picks are moving - compare before checkoutAmazon US: current deals, useful picks and tech finds.See Picks×
VGSOURCES
Get listed

DevOpsPATCH 2026.10.16

How to Deploy a Jekyll Site with Git Hooks on a Linux VPS

By VGSources Team 4 min read

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The simplest reliable setup is a bare Git repository owned by a dedicated SSH deploy user. A post-receive hook accepts a push, checks that it targets your production branch, clones that revision into a temporary directory, runs bundle exec jekyll build, and publishes the generated files to a directory served by Nginx or Apache. You then deploy from your workstation with git push deploy main.

Deployment architecture

A normal Git repository contains a working tree. A bare repository contains only Git’s objects and references, so it is appropriate as the destination for an SSH push. The VPS never serves that repository directly. Instead, the hook creates a disposable checkout and publishes Jekyll’s static output to a separate web directory.

As an Amazon Associate I earn from qualifying purchases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  1. Your workstation pushes to [email protected]:~/myrepo.git.
  2. SSH invokes Git’s receive process for the bare repository.
  3. After the ref update is accepted, the repository’s executable hooks/post-receive reads the updated ref.
  4. The hook checks out the approved branch, resolves the site’s locked Ruby gems, and runs Jekyll.
  5. The resulting HTML, CSS, JavaScript, images, and feeds are placed in a release directory.
  6. Nginx serves the active release through a symlink; the bare repository and temporary checkout remain outside the document root.

Git documents that hooks without the executable bit are ignored. Its post-receive hook runs after proposed reference updates have been processed, and Git invokes receive hooks with the bare repository as the working directory. The Linux githooks(5) manual also describes the exported GIT_DIR environment variable and the configurable hooks path.

What you need before starting

Requirement Purpose Check
Linux VPS with SSH access Runs Git, Ruby, Bundler, Jekyll, and the web server ssh user@server
Git Stores the bare repository and receives pushes git --version
Ruby and Bundler Install the site’s gems and invoke Jekyll ruby --version and bundle --version
A Gemfile and, preferably, Gemfile.lock Reproducible Jekyll and plugin versions test -f Gemfile
Nginx or Apache Serves the generated static directory Confirm the service is running
DNS for the site Points the public hostname at the VPS Resolve the hostname to the server address
An SSH key for deployment Authenticates the workstation without a password Key listed in the deploy account’s authorized_keys

Package names and supported Ruby versions vary by distribution. Install the current versions supplied by your Linux release, then let the site’s Gemfile control Jekyll and plugin versions. Do not copy the package list from an old tutorial unchanged: for example, the Ubuntu 16.04 instructions in this 2018 guide are useful for the deployment pattern but are dated for current systems.

#1 Best Overall
Sale
Gaoye Blue Light Blocking Glasses | Anti UV Ray, For Computers & Gaming, Square Frame, Eyewear for Men and Women
  • BLUE LIGHT BLOCKING GLASSES: Our blue light glasses for women boast UV400 protection, blocking harmful blue rays from computer screens. With these bluelight glasses women, you can enjoy gaming, reading, or watching TV with no worries of eye strain.
  • EYE RELIEF: Our blue light glasses are engineered to reduce blurry vision or strain caused by prolonged screen time. These womens blue light glasses aid in better sleep by preventing blue light from disrupting your natural sleep cycle, helping you fall asleep faster and enjoy a more restful night's sleep, making them the perfect christmas present.
  • COMFORTABLE: Crafted from durable material, our trendy blue light glasses for woman or blue light glasses men ensure long-lasting comfort. The high-transmittance lenses accessories, gamer gifts for men, help keep your eyes relaxed. Perfect stocking stuffers, gifts for gamers men, christmas gifts for men, halloween costumes.
  • LIGHTWEIGHT: These clear blue light glasses feature a lightweight frame, meaning they’ll stay comfy for long-term wear. Perfect as blue blockers glasses for women or mens blue light glasses, these non-prescription fake glasses for men can be worn throughout the day. The blue light blocking glasses women feature polycarbonate HD lenses, which are anti-reflective and restore true color.
  • WORRY-FREE PURCHASE: If you experience any issues, our support team is ready to assist you quickly. These are the perfect costume glasses for cosplay dressing up.

Create a dedicated deployment account

Use a separate Unix account rather than your personal login or a web-server account. It needs to read the bare repository and write releases, but it should not own unrelated application data.

  1. Log in as an administrator and create the account, for example deployer. Choose a home directory and a shell permitted by your SSH policy.
  2. Create /home/deployer/.ssh with mode 700, add only the required public key to authorized_keys, and set that file to mode 600.
  3. Test key-only access from your workstation before disabling password authentication for this account.
  4. When the account only needs to receive Git pushes, consider git-shell or an SSH forced command. Apply the restriction only after an unrestricted setup has been tested, because an incorrectly constrained command can prevent Git from starting its receive process.

The hook executes as this account. It therefore needs write permission for the release area and read permission for the repository, while the Nginx or Apache worker only needs read and directory-traverse permission.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Install the runtime and prepare directories

Install Git, Ruby, Bundler, a compiler toolchain for gems with native extensions, and your chosen web server using your distribution’s supported package manager. Verify each executable:

git --version
ruby --version
bundle --version
nginx -v

If your distribution does not ship the Bundler version required by the lockfile, install the version specified by the project and verify it with bundle check. Run all dependency and build commands as deployer; installing gems as root creates ownership and security problems.

The example below keeps Git data private and uses release directories so a failed build cannot replace the currently served site:

Rank #2
Windex Gaming Cleaning Wipes, Pre-Moistened Wipes to Instantly Clean all Gaming Gear and Electronics, Resealable Packaging for a Freshness Lock, 25 count (Pack of 1)
  • WINDEX GAMING WIPES: effortlessly clean all your gaming gear and gaming electronics in one easy step with our new Windex Gaming Wipes
  • AMMONIA FREE: our ammonia-free formula is safe to use on all of your favorite gaming equipment like consoles, headsets, controllers, screens, keyboards, and more
  • PRE-MOISTENED WIPES: each wipe instantly removes dust, dirt, and stubborn smudges and fingerprints leaving a streak-free shine
  • ANTI-STATIC: great for cleaning and wiping down your gaming gear and electronics leaving behind no visible residue
  • COMPACT RESEALABLE PACKAGE: store your pack of Windex Gaming Wipes anywhere in your home for whenever a quick and easy wipedown is needed
sudo mkdir -p /var/www/myrepo/releases
sudo chown -R deployer:deployer /var/www/myrepo
sudo chmod 755 /var/www
sudo -u deployer mkdir -p /home/deployer

The eventual layout is:

  • /home/deployer/myrepo.git — bare repository and hooks.
  • /var/www/myrepo/releases/... — completed Jekyll builds.
  • /var/www/myrepo/current — symlink to the active release.
  • /tmp/myrepo.XXXXXX — disposable checkout used by one hook run.

Keep all of these except the active release outside any directory that contains user-uploaded or unrelated public files. Never point a virtual host at the bare repository.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Initialize the bare repository

Switch to the deploy account and create the repository:

sudo -iu deployer
mkdir -p ~/myrepo.git
cd ~/myrepo.git
git --bare init
exit

A bare repository may display a warning about its default branch name. That does not prevent deployment; the hook below explicitly accepts refs/heads/main. If your production branch is named differently, change the branch in one place in the hook and in the push command.

Configure Nginx to serve only generated files

Point the virtual host’s document root at the current symlink, not at releases and not at the Git repository. A minimal Nginx server block is:

server {
    listen 80;
    listen [::]:80;
    server_name example.com www.example.com;

    root /var/www/myrepo/current;
    index index.html;

    location / {
        try_files $uri $uri/ =404;
    }
}

Enable the site according to your distribution, validate the configuration, and reload Nginx:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
LISEN Cell Phone Stand Phone Holder for Desk, Office Decor Gadgets for Men | Office Gifts for Women, iPhone Stand, Gadgets for Men, Office Decor, Gaming Desk Accessories for Samsung Fold 8, Switch, iPad
  • Ergonomic & Adjustable Design: Fight "text neck" and improve your posture. Designed for comfort, it offers an adjustable height (7.1in-8.5in) (1.4in adjustable range) and angle (5°-85°) Please note: cell phone stand is only 9 inches tall—the length of a standard pencil
  • Without blocking subtitles Perfect for office desk Tiktok Face Time Zoom video—this is the ultimate kitchen desk essential for phones! Perfect viewing experience while reducing neck back strain, A must-have for gamers streamers desk, and anyone who values both style and support!
  • Sleek & Stable Design fits Otterbox Case: Say goodbye to bent cables, tangles, and tip-overs! LISEN’s stylish adjustable desk phone holder features a built-in charging hole and smart cable management, keeping your phone secure and your workspace clutter-free cool gadgets for men
  • ANTI-SLIP DESIGN free hands: The under 10.00 items easy gadgets back and the bottom of this kitchen essentials for women are fully covered by anti-skid silicone, which LISEN stand up desk decor can provide maximum protection device from any scratches and slides
  • Your Perfect Viewing Companion:If your product arrives damaged or breaks within 365 days, reach out to LISEN for a quick and hassle-free solution. Struggling with assembly, like tightening the screw? We’ve got your back! Your experience matters to us. (Product including: phone Holder stand*1, screw*1, hexagon screwdriver*1, specification*1)
sudo nginx -t
sudo systemctl reload nginx

Apache can use the same /var/www/myrepo/current path as its virtual-host DocumentRoot. The web server must be able to traverse /var/www/myrepo, follow the symlink, and read files in the selected release. Add HTTPS separately with the certificate tooling appropriate for your distribution; TLS is not provided by the Git hook.

Make the Jekyll build reproducible

Commit a Gemfile that declares Jekyll and every plugin required by the site. Generate and commit Gemfile.lock when the project supports locking. A typical Gemfile might contain:

source 'https://rubygems.org'

gem 'jekyll'
gem 'jekyll-feed'

The exact gem list belongs to your site. Build locally with the same command the server will use:

bundle install
bundle exec jekyll build

Resolve warnings and plugin errors before enabling automatic deployment. A hook that runs the system-wide jekyll executable instead of bundle exec can silently use a different version from the one tested in source control.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Install a branch-aware post-receive hook

The following hook accepts only pushes to main, serializes concurrent deployments with flock, builds in a temporary checkout, and switches Nginx to a completed release only after Jekyll exits successfully. It also handles a push that contains several refs by deploying the last accepted main update.

Rank #4
Ledagic IC+RGBW USB Powered Led Light Bar with App & Remote Control, 2 Pack
  • Easy Installation: Our gaming lights have been designed to enhance your entertainment experience. Simply position the led light bar next to your TV or game console to create a game room environment with ease. They come with USB power and a 60 inch cord for direct mounting and mobility
  • Audio Syncing & Extensive Mode: The built-in high-sensitivity music sensor allows you to sync the TV led lights to your favorite music. Lights react and move to the beat of music, film and game audio, creating an incredible immersive sound and light experience – and all without the need for an additional hub. You can choose from 64+ patterns, including strobe, illusion, jump, energy, gradient, running, chasing, fluttering mode etc. Each mode can be applied to different scenes
  • 64+ Chasing IC+RGB & W Effect: The independent control design of IC+RGB and white all-in-one multifunctional rgbw led bar lights monitor backlight allows you to easily switch the led lights for desk between IC+RGB and white to enjoy a variety of lighting effects, you can choose white lighting mode with high brightness for better illumination when working, etc. Choose IC+RGB lighting mode when you need to create an entertaining atmosphere for the light show, 16 million colours of Color changing rgb light bar let you dance to the beat and create a dynamic party atmosphere
  • Dynamic and Dimmable Lights: 1%-full brightness free brightness adjustment gives you the flexibility to adjust dimmable led light bar for room decorations or a variety of occasions
  • USB Powered: USB light bars for room can be powered by powernank, usb charger, TV, Monitor, laptop PC mainframe, making behind TV led lighting bar easy to install in any location.TV led lights are powered by the TV usb interface / PC mainframe, can be turned on/off synchronously with TV / PC
#!/usr/bin/env bash
set -euo pipefail

# Git invokes receive hooks from the bare repository.
GIT_DIR=/home/deployer/myrepo.git
PUBLIC_BASE=/var/www/myrepo
RELEASES="$PUBLIC_BASE/releases"
CURRENT="$PUBLIC_BASE/current"
LOCK_FILE=/home/deployer/.myrepo-deploy.lock
TMP_GIT_CLONE="$(mktemp -d /tmp/myrepo.XXXXXX)"
NEW_RELEASE=''
TARGET_REV=''
DEPLOY=false

# Do not let an inherited checkout setting affect commands against another repository.
unset GIT_WORK_TREE

while IFS=' ' read -r oldrev newrev ref; do
    case "$ref" in
        refs/heads/main)
            # Ignore deletion of the production branch.
            [[ "$newrev" == 0000000000000000000000000000000000000000 ]] && continue
            DEPLOY=true
            TARGET_REV="$newrev"
            ;;
    esac
done

$DEPLOY || exit 0

exec 9>"$LOCK_FILE"
if ! flock -n 9; then
    echo 'Another deployment is running; try the push again.' >&2
    exit 1
fi

cleanup() {
    rm -rf "$TMP_GIT_CLONE"
    if [[ -n "${NEW_RELEASE:-}" ]]; then
        rm -rf "$NEW_RELEASE"
    fi
}
trap cleanup EXIT

printf 'Deploying %sn' "$TARGET_REV"
git clone "$GIT_DIR" "$TMP_GIT_CLONE"
git -C "$TMP_GIT_CLONE" checkout --force main

if [[ ! -f "$TMP_GIT_CLONE/Gemfile" ]]; then
    echo 'Gemfile is required for the server build.' >&2
    exit 1
fi

(
    cd "$TMP_GIT_CLONE"
    BUNDLE_GEMFILE="$TMP_GIT_CLONE/Gemfile" bundle install --jobs 4 --retry 3
)

NEW_RELEASE="$(mktemp -d "$RELEASES/release.XXXXXX")"
(
    cd "$TMP_GIT_CLONE"
    BUNDLE_GEMFILE="$TMP_GIT_CLONE/Gemfile" 
        bundle exec jekyll build 
        --source "$TMP_GIT_CLONE" 
        --destination "$NEW_RELEASE"
)

# Replace the symlink in one rename, leaving the previous release available if needed.
ln -s "$NEW_RELEASE" "$CURRENT.next"
mv -Tf "$CURRENT.next" "$CURRENT"
printf 'Published %sn' "$NEW_RELEASE"

Save it as /home/deployer/myrepo.git/hooks/post-receive and make it executable:

sudo -iu deployer
chmod 755 ~/myrepo.git/hooks/post-receive
ls -l ~/myrepo.git/hooks/post-receive

The executable mode matters: Git explicitly ignores a hook that does not have its executable bit set. The script uses an absolute GIT_DIR so its behavior does not depend on the shell's current directory. It also unsets GIT_WORK_TREE, which prevents an inherited work-tree setting from redirecting commands intended for the temporary checkout.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Understand the hook's safety choices

Branch and ref validation

The hook compares the complete ref name, refs/heads/main, rather than interpolating a branch name supplied by a client. This prevents a feature-branch push from publishing accidentally and avoids treating arbitrary ref text as shell input. Change the literal only if your production branch has another fixed name.

Temporary checkout and dependency installation

Each accepted push gets a unique directory under /tmp. Bundler reads the checked-out Gemfile, and bundle exec jekyll build uses the project's locked dependency set. The temporary directory is removed by the exit trap whether the build succeeds or fails.

Release switching and rollback

Jekyll writes into a new directory. A failed dependency install or build therefore leaves the current symlink untouched. To roll back a successful but unwanted deployment, list the releases, then point the symlink at a previous one:

Best Value
Sale
HUANUO FlowLift™ Dual Monitor Stand, Fully Adjustable Gaming Monitor Desk Mount for 13–32″ Computer Screens, Full Motion VESA 75x75/100x100 with C-Clamp & Grommet Base, Each Arm Holds 4.4 to 19.8 lbs
  • Compatible with Wide Screens - To ensure compatibility with the dual monitor mount, your each monitor must meet three conditions at the same time: First, computer screens size range: 13 to 32 inches. Second, screen weight range: 4.4 to 19.8 lbs. Third, the back of the monitor screen must have VESA mounting holes with a pitch of 75x75mm or 100x100mm.
  • Regarding the compatibility with desks - Your desk must meet three conditions at the same time: First, desk material: Only wooden desks are recommended, plastic or glass desks cannot be used. Second, desk thickness range: 0.59" - 3.54". Third, the bottom of the desk should not have any cross beams or panels, as this will interfere with installation. We recommend carefully checking that your desk and monitors meets all above conditions before purchasing.
  • Dual C-Clamp Hold - Worried your dual monitors might wobble or slip? Our upgraded base uses a larger platform plus a dual C-clamp structure to lock the dual monitor arm firmly to your desk. Each arm safely keeps your screens steady while you type, click and game—no shaking, no sliding, just a clean and secure setup you can trust every day. It also provides Grommet Mounting installation choice, both options ensure stable and secure fixation for your 0.59" - 3.54" desk.
  • Full-Motion Adjustment For Comfortable View - Pull the screen closer when you’re deep in a spreadsheet, push it back to watch videos, or rotate to portrait for coding — moving everything smoothly with just one hand. The monitor stand offers +85°/-50° tilt, ±90° swivel and 360° rotation. Raise your monitor up to 15.75″ to support a healthy sitting posture. Whether you’re working from home, gaming through the night, or switching between video calls and documents, getting the screens to your natural line of sight helps relieve neck, shoulder and back strain so you can stay focused longer with less fatigue.
  • Keep Your Desk Organized: By lifting both screens off the desktop, this dual monitor stand opens up valuable space for your keyboard, notebook, docking station or a simple, clutter-free work area. Built-in cable management guides wires along the arms, keeping cords out of sight and out of the way. Enjoy a tidy, modern workstation that looks as good as it feels to use.
sudo -iu deployer
ls -1dt /var/www/myrepo/releases/release.*
ln -s /var/www/myrepo/releases/release.PREVIOUS /var/www/myrepo/current.next
mv -Tf /var/www/myrepo/current.next /var/www/myrepo/current

Remove obsolete release directories only after confirming that the active release is healthy. If you prefer a single output directory instead of symlinked releases, follow Jekyll's documented sequence of cloning the bare repository to a temporary directory, running Bundler, and building directly to the configured public directory; staging first is safer when preserving the previous site matters.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Concurrent pushes

The file descriptor lock prevents two builds from switching the active symlink at the same time. A second push exits with a clear error and can be retried. If your hosting environment does not provide flock, use an equivalent OS-level lock and test its stale-lock behavior before relying on it.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Connect the workstation and deploy

From the local clone, add an SSH remote. The tilde is expanded by the remote shell, so it refers to the deploy user's home directory:

git remote add deploy [email protected]:~/myrepo.git
git remote -v
git push deploy main

Git sends the ref update over SSH. The hook's output is normally shown in the push response. A successful run ends with a message such as Published /var/www/myrepo/releases/release.xxxxxx. Visit the site, verify a page that changed in the commit, and check that links, assets, feeds, and any configured custom domain all resolve.

If the remote rejects a feature branch, that is intentional: merge it into main and push the production branch. If the push reports success but the page is unchanged, inspect the active symlink and the web server's error log rather than rebuilding manually first:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
readlink -f /var/www/myrepo/current
find /var/www/myrepo/current -maxdepth 2 -type f | head
sudo journalctl -u nginx --since '10 minutes ago'

Troubleshoot common failures

“Permission denied” when Git runs the hook

  • Check that post-receive is owned by deployer and has mode 755 or another executable mode.
  • Check directory traversal permissions on /home/deployer, ~/myrepo.git, /var/www/myrepo, and releases.
  • Confirm that the hook, not a manual root shell, is creating release directories. Existing root-owned files can block later pushes.

Bundler cannot install a gem

  • Run bundle check as deployer inside a temporary checkout to see the missing dependency.
  • Confirm that the VPS has the compiler and development libraries required by native gems.
  • Verify the Ruby version and Bundler version against the project's lockfile.
  • Do not delete the live release while investigating; the hook stages a new release and leaves the active one in place on failure.

Jekyll builds locally but fails on the VPS

  • Compare the Ruby, Bundler, Jekyll, and plugin versions rather than assuming the system executable matches the workstation.
  • Check case-sensitive paths. Linux treats About.md and about.md as different files.
  • Look for environment-dependent configuration, missing files excluded by .gitignore, and plugins that expect credentials or network access.
  • Read the complete hook output; redirect it to a protected log file if the push response is truncated.

The site returns 403 or 404

  • Run readlink -f /var/www/myrepo/current and confirm that it resolves to a completed release containing index.html.
  • Check that the Nginx or Apache user can traverse every parent directory and read the files.
  • Validate the virtual host's server_name or Apache host declaration and reload the web server after configuration changes.
  • Confirm that Jekyll's baseurl and url settings match the path and hostname being requested.

A push hangs or a second push is rejected

  • A gem compilation or Jekyll build may still be running. Inspect the process list and hook output before killing it.
  • If the process died while holding the lock, verify that the operating system closed the file descriptor; flock releases locks when the process exits.
  • Do not allow unbounded concurrent builds. Keep the lock, or move builds to a queue or CI runner when deployment volume grows.

Security and operational hardening

  • Use SSH keys for the deploy account and disable password login for it where your access policy permits.
  • Keep the bare repository, Gem caches, temporary checkouts, and release history outside the public document root.
  • Give the deploy account write access only to the repository and release tree. Give the web-server account read and traverse access, not write access.
  • Pin Ruby and gem dependencies in Gemfile.lock; review dependency changes like application code.
  • Validate a fixed ref before deploying. Never execute a client-provided branch or path as shell syntax.
  • Capture hook output in a log owned by the deploy account with restrictive permissions, and rotate that log.
  • Keep at least one known-good release until the new one has been checked. A failed build must not erase the live site.
  • Review who can add keys to authorized_keys and who can edit the hook. Anyone who can modify the hook can execute commands as the deploy account.
  • Apply operating-system updates, firewall rules, and TLS configuration independently of the deployment hook.

When a direct Git hook is the right choice

A post-receive hook is attractive when one repository publishes to one VPS and the server can build Ruby dependencies reliably. It has very little moving infrastructure: an SSH remote, a bare repository, one script, and a web root. The trade-off is that the VPS performs the build and owns the deployment policy.

Approach Where the build runs Strength Trade-off
Direct post-receive hook VPS Smallest setup and immediate push feedback Build isolation, logs, queues, and secrets are your responsibility
CI service Hosted or self-hosted runner Repeatable clean environments, approvals, artifacts, and audit history Requires pipeline configuration and a secure deployment credential
Webhook-driven deployer Usually a separate service or runner Can coordinate several repositories or environments Introduces an HTTP endpoint, signature validation, and another failure point
Static publishing platform Provider's build infrastructure Less VPS maintenance and built-in deployment history Less control over networking, runtime, and hosting layout
Rake, SSH, or scp script Workstation or VPS, depending on the script Useful for an occasional or manually approved release Easy to omit branch checks, locking, rollback, or dependency pinning

Jekyll's automated deployment documentation lists CI services, webhooks, static publishers, Rake or SSH scripts, and scp as alternatives. Choose a CI or webhook design when several contributors, environments, approval gates, or compliance logs make a one-server hook difficult to audit. Keep the direct hook when the repository-to-VPS path is intentionally simple and you are prepared to maintain its runtime, permissions, logs, and rollback procedure.

Deployment checklist

  • The deploy account authenticates with the intended SSH key and has no unnecessary keys.
  • git --bare init was run in ~/myrepo.git.
  • The hook is named post-receive, has an executable bit, and accepts only the production ref.
  • Ruby, Bundler, Git, and Jekyll are available to the deploy account, not merely to root.
  • The Gemfile and lockfile are committed and the same bundle exec jekyll build succeeds locally.
  • Nginx or Apache serves /var/www/myrepo/current and can read the active release.
  • A failed build leaves the old symlink target untouched.
  • A successful push changes the active release and the site displays the new content.
  • You know how to switch the symlink back to a previous release and where to find hook and web-server logs.

With those pieces in place, git push deploy main is the complete release command: Git receives the commit, the hook builds the exact project dependencies, and the web server exposes only the finished static output.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

DevOpsGitJekyllLinux VPSNGINXStatic sites

Leave a reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.