惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

J
Java Code Geeks
Martin Fowler
Martin Fowler
MongoDB | Blog
MongoDB | Blog
博客园 - Franky
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Microsoft Security Blog
Microsoft Security Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
博客园_首页
腾讯CDC
D
Docker
The Cloudflare Blog
量子位
爱范儿
爱范儿
L
LangChain Blog
博客园 - 三生石上(FineUI控件)
博客园 - 司徒正美
aimingoo的专栏
aimingoo的专栏
Blog — PlanetScale
Blog — PlanetScale
Jina AI
Jina AI
Apple Machine Learning Research
Apple Machine Learning Research
Hugging Face - Blog
Hugging Face - Blog
博客园 - 聂微东
Vercel News
Vercel News
MyScale Blog
MyScale Blog

Danb Blog

August 2026: What I've Been Working On · Danb Blog Great Tech: Intel 2500k CPU · Danb Blog July 2026: What I've Been Working On · Danb Blog My Experience with Ubuntu Desktop 26.04 · Danb Blog Thumbnails for Orca 3MF in GNOME Files · Danb Blog Cheaper Sodastream Gas with a Big Tank · Danb Blog June 2026: What I've Been Working On · Danb Blog Running Snyk On Forgejo/Codeberg Actions · Danb Blog Tuta & Proton: An Open Source Client Does Not Result in an Open Source Service · Danb Blog May 2026: What I've Been Working On · Danb Blog 3D Printing Parts for my Greenhouse, Round 2 · Danb Blog Great Devices: Nexus 7 2013 · Danb Blog R36S Console RetroArch Stuck Menu Issue · Danb Blog April 2026: What I've Been Working On · Danb Blog Basic OpenCode Sandboxing with Docker · Danb Blog Games Played in 2025 · Danb Blog March 2026: What I've Been Working On · Danb Blog Shivam Mathur's "node-docker" Images are Awesome for PHP CI · Danb Blog February 2026: What I've Been Working On · Danb Blog Your BookStackApp project was assigned as a project for my Software Architecture course · Danb Blog My Sovol SV08 3D Printer Setup in 2026 · Danb Blog January 2026: What I've Been Working On · Danb Blog Epson Printer: The administrator password you entered was not recognized · Danb Blog Pressure to Follow Process · Danb Blog Online Shopping Email Notifications · Danb Blog My HomeLab Setup in 2026 · Danb Blog Linux Label Printing with the Phomemo D30 · Danb Blog Reporting to the CMA: Google Android Developer Verification · Danb Blog OPNsense & Dnsmasq: Responding with specific DNS servers · Danb Blog An Impromptu Introduction to ZFS Drive Replacement at 1am · Danb Blog
My Favourite Static Site Deploy Method · Danb Blog
2023-04-22 · via Danb Blog

There are many ways to deploy an application to a server, and often that depends on the technologies in play, access management and application setup. That said, even for a simple static site I think it’s common to folks to over complicate things. On Reddit I often see folks advising newbies to look into CI or git-hook based deployments as initial places to look, or even worse they start talking about kubernetes.

Personally I’m a fan of simplicity, and for simple personal static sites I have found the following to be my favourite:

// package.json
{
  //...
  "scripts": {
    "deploy": "<build-cmd> && rsync -avx --delete dist/ server-a:/var/www/site/"
  }
  //...
}

I’m almost always using npm in some way in static-site projects, so typically use npm scripts for convenience. As above, I just add a deploy script that first runs my build command (Commonly another npm script) before running rsync to copy up the project to the target server, with the --delete option to get rid of anything on the server location that’s not in the local folder being deployed. Good old trusty rsync makes this nice and fast, by only transferring changes.

With this set, I can simply run npm run deploy and everything is deployed in an efficient manner with an easy-to-remember command. Some may scoff at how manual this is to kick-start, compared to their auto-triggered deployment process, but tbh I like the manual control of this in addition to the lack of external systems involved. I use this for pretty much anything static, including this blog. A slightly more complex example can be seen within the BookStack website repo.