Static HTML

ដេប្លយកម្មវិធី Static HTML របស់អ្នក

If you've got a folder of .html files and the assets they reference, there's no build step to run — that folder already is the deployable thing. This is the whole reason harvis exists.

steps
  1. 01

    There's no build step

    A plain HTML site is already in its final form. Whatever a framework's build command produces for you, you already have by hand — nothing to compile or bundle.

  2. 02

    Make sure there's an entrypoint

    Have an "index.html" at the top of the folder — that's what loads when someone visits the site's address with no path after it.

  3. 03

    ដេប្លយវា

    ដំណើរការ "npx harvis deploy ." ពី root គម្រោងរបស់អ្នក។ មិនចាំបាច់ config និងមិនចាំបាច់ចូលសម្រាប់ deploy ដំបូងនេះទេ — អ្នកទទួលបាន URL ផ្ទាល់ភ្លាមៗ ព្រមទាំងតំណទាមទារឯកជនមួយ ដើម្បីភ្ជាប់គេហទំព័រទៅគណនីឥតគិតថ្លៃមួយនៅពេលណាដែលអ្នកត្រៀមខ្លួនរួចរាល់។

ដេប្លយ Static HTML ដោយពាក្យបញ្ជាតែមួយ

Build គម្រោងរបស់អ្នក រួចប្រគល់ថតលទ្ធផលទៅ harvis។ មិនចាំបាច់មានគណនីសម្រាប់ deploy ដំបូងទេ — អ្នកនឹងទទួលបានតំណភ្ជាប់ផ្ទាល់ និងតំណទាមទារឯកជនមួយ ដើម្បីគ្រប់គ្រងវានៅពេលក្រោយ។

terminal
npx harvis deploy .

ចង់អូសឯកសារជំនួសឱ្យប្រើ terminal មែនទេ? Build គម្រោង រួច ទម្លាក់ថតលទ្ធផលនៅទីនេះ ហើយផ្សព្វផ្សាយវាតាមរបៀបដដែល។

git hook

Deploy Static HTML on every git push

The command above is one you will run again after every change. A git hook runs it for you, so every push publishes the folder before it leaves your machine.

The folder holding the finished site. "." is the repo root, which is right for hand-written HTML; a static-site generator writes somewhere else.

Runs the build first, with "set -e" above it — so a failed build stops the push instead of republishing whatever the folder held last time.

pre-push fires on every branch and every remote, so a feature branch would publish over your live site. With this on, a push from anywhere else exits early and goes through untouched.

in your repo root
printf '#!/bin/sh\nharvis deploy .\n' > .git/hooks/pre-push
chmod +x .git/hooks/pre-push

The options, the gotchas and how to share a hook with your team are on the git hook page.

សំណួរអំពីការដេប្លយ Static HTML

Can I deploy just one file, or does it need to be a folder?

Either. A single "index.html" with no other files works fine — drag it in or point the CLI at its folder. Add a "styles.css" or an "images" folder alongside it and those publish too, as long as your HTML references them with relative paths.

Do relative links between my pages work correctly?

Yes — the folder structure you upload is served exactly as-is, so a link from index.html to about.html (or to images/logo.png) resolves the same way it would opening the files locally, as long as the paths are relative rather than pointing at your local filesystem.

តើការដេប្លយកម្មវិធី Static HTML ទៅ harvis ឥតគិតថ្លៃពិតប្រាកដមែនទេ?

បាន មិនចាំបាច់ប្រើកាតទេ។ ដែនកំណត់ឥតគិតថ្លៃគឺឯកសារ ៥០០ និង ៥០ MB ក្នុងមួយគេហទំព័រ ដែលគ្រប់គ្រាន់សម្រាប់ build Static HTML static ដោយមានទំហំគ្រប់គ្រាន់។ គេហទំព័រដែលបានផ្សព្វផ្សាយមិនផុតកំណត់ទេ — ពួកវានៅតែដំណើរការរហូតដល់អ្នកលុបពួកវាចេញ។

តើខ្ញុំអាចប្រើ domain ផ្ទាល់ខ្លួនរបស់ខ្ញុំជាមួយគេហទំព័រ Static HTML ដែលបានដេប្លយបានទេ?

គេហទំព័រនីមួយៗទទួលបានអាសយដ្ឋាន harvis.page ឥតគិតថ្លៃមួយ ហើយអ្នកអាចជ្រើសរើស subdomain ផ្ទាល់ខ្លួនរបស់អ្នកពី dashboard បន្ទាប់ពីទាមទារវា — ដូចជា my-app.harvis.page ជំនួសឱ្យអាសយដ្ឋានចៃដន្យ។ ការចង្អុល domain ដែលអ្នកមានស្រាប់ (ដូចជា mystore.com) ទៅកាន់គេហទំព័រនេះមិនទាន់អាចធ្វើបានទេនៅឡើយ។

តើវាខុសពីការដេប្លយ Static HTML ទៅ Vercel ឬ Netlify យ៉ាងដូចម្តេច?

Vercel និង Netlify ត្រូវបានបង្កើតឡើងជុំវិញការភ្ជាប់ Git repo និងដំណើរការ build របស់អ្នកនៅលើ server របស់ពួកគេ ជាមួយ dashboard មួយសម្រាប់កំណត់រចនាសម្ព័ន្ធ។ harvis រំលងអ្វីៗទាំងនោះទាំងអស់៖ អ្នក build នៅមូលដ្ឋាន (ឬនៅក្នុង CI ផ្ទាល់ខ្លួនរបស់អ្នក) ដំណើរការពាក្យបញ្ជា CLI តែមួយប្រឆាំងនឹងថតលទ្ធផល រួចទទួលបានតំណភ្ជាប់មួយ — មិនចាំបាច់រៀបចំគម្រោង និងមិនចាំបាច់មានគណនីទេ រហូតដល់អ្នកចង់រក្សាគេហទំព័រនោះ។

other frameworks

កំពុងដេប្លយអ្វីផ្សេងទៀតមែនទេ?

រូបមន្តដូចគ្នាគ្រប់ទីកន្លែង — build វា រួច npx harvis deploy លទ្ធផល។