diff --git a/README.md b/README.md index 6ef4e16..d3686fa 100644 --- a/README.md +++ b/README.md @@ -87,33 +87,37 @@ git commit -m "new post" git push origin master ``` -The [deploy workflow](.gitea/workflows/deploy.yml) runs three gated stages: +The CI is written for **Gitea Actions** and lives in two workflow files under +`.gitea/workflows/`. Each workflow contains jobs, and the jobs are chained with +`needs:` — a job's gates — so downstream jobs physically cannot start until +everything they depend on has passed. -1. **build** — checks out the repo, sets up Node 22, and runs a single - `yarn install --frozen-lockfile` that serves the whole stage: it runs - `hexo generate`, then lints all Markdown in `source/` and `scaffolds/` - with `markdownlint-cli2` (house style codified in - `.markdownlint-cli2.jsonc`; lint failures fail the stage), then optimizes - every PNG/JPEG in the built output with pngquant/jpegoptim (~56% smaller - images, originals in `source/` untouched). The site is uploaded as a - workflow artifact -2. **test** — validates the built artifact without touching production: - structural checks (index, theme assets, file count) plus a serving smoke - test that requests the homepage, a real post page, and the stylesheet - over a local HTTP server -3. **deploy** — only runs if build and test both passed; downloads the - tested artifact, writes an SSH deploy key from the `DEPLOY_KEY` secret, - and `rsync -avz` over SSH (key-based only; the server rejects password - auth) to `root@69.164.253.99:/www/wwwroot/leonxu260.dev/` +**[deploy.yml](.gitea/workflows/deploy.yml)** — triggers on every push to `master` +(plus manual dispatch from the Actions tab). Three jobs: + +- **`build`** — checks out the repo, sets up Node 22, and runs a single + `yarn install --frozen-lockfile` for the whole job; then `hexo generate`, a + Markdown lint over `source/` and `scaffolds/` with `markdownlint-cli2` + (house style codified in `.markdownlint-cli2.jsonc`; lint failures fail the + job), image optimization with pngquant/jpegoptim (~56% smaller images, + originals in `source/` untouched), and finally uploads `public/` as the + `site` workflow artifact +- **`test`** (`needs: build`) — downloads the artifact, no rebuild, and never + touches production: structural checks (index, theme assets, file count) + plus a serving smoke test that requests the homepage, a real post page, and + the stylesheet over a local HTTP server +- **`deploy`** (`needs: test`) — downloads the tested artifact, writes an SSH + deploy key from the `DEPLOY_KEY` secret, and `rsync -avz` over SSH + (key-based only; the server rejects password auth) to + `root@69.164.253.99:/www/wwwroot/leonxu260.dev/` Transfers are incremental — the first deploy took ~100 s; subsequent runs finish in -seconds. The workflow also supports manual dispatch from the Gitea Actions tab. The -server runs BT Panel (BTPanel) + nginx, which serves the synced `public/` output -directly as the webroot. +seconds. The server runs BT Panel (BTPanel) + nginx, which serves the synced +`public/` output directly as the webroot. -A separate [lint workflow](.gitea/workflows/lint.yml) runs the same Markdown lint on -pushes to non-`master` branches and on pull requests, so style feedback arrives -without duplicating the master deploy chain's dependency install. +**[lint.yml](.gitea/workflows/lint.yml)** — runs the same Markdown lint on pushes to +non-`master` branches and on pull requests, so style feedback arrives without +duplicating the master chain's dependency install. ## Support