Tweaks, fixes, etc
This commit is contained in:
36
README.md
36
README.md
@@ -70,9 +70,9 @@ Static landing site for **mifi.holdings** (and www). Plain HTML/CSS/JS source; a
|
||||
|
||||
- **Output**: `dist/` (gitignored). Do not edit `dist/`; it is generated.
|
||||
- **Steps** (see `scripts/build.js`):
|
||||
1. Clean and copy `src/` → `dist/`.
|
||||
2. Minify all `.js` (terser) and `.css` (clean-css).
|
||||
3. Inline critical CSS with **Critters** (lazy-loads the rest; no browser required, so it works in CI).
|
||||
1. Clean and copy `src/` → `dist/`.
|
||||
2. Minify all `.js` (terser) and `.css` (clean-css).
|
||||
3. Inline critical CSS with **Critters** (lazy-loads the rest; no browser required, so it works in CI).
|
||||
- **When**: Run before `docker build`. CI and the build pipeline both run `pnpm build` before packaging.
|
||||
|
||||
---
|
||||
@@ -81,7 +81,7 @@ Static landing site for **mifi.holdings** (and www). Plain HTML/CSS/JS source; a
|
||||
|
||||
- **Frontend**: Static HTML + CSS + JS in `src/`; production build minifies and inlines critical CSS.
|
||||
- **Server**: nginx (Alpine) in Docker.
|
||||
- **Tooling**: **pnpm**; Prettier (format); ESLint (JS), Stylelint (CSS), yamllint (YAML); **terser**, **clean-css**, **critters** (build).
|
||||
- **Tooling**: **pnpm**; Prettier (format); ESLint (JS), Stylelint (CSS), yamllint (YAML); **terser**, **clean-css**, **beasties** (build).
|
||||
- **Deployment**: Docker image (from `dist/`) → Gitea registry → Portainer stack redeploy.
|
||||
|
||||
---
|
||||
@@ -93,9 +93,9 @@ Static landing site for **mifi.holdings** (and www). Plain HTML/CSS/JS source; a
|
||||
- **Lint**: `pnpm lint` (ESLint for `src/**/*.js`, Stylelint for `src/**/*.css`, yamllint for Woodpecker + docker-compose). Use `pnpm lint:fix` to auto-fix where supported.
|
||||
- **Build**: `pnpm build` → produces `dist/`. Required before building the Docker image.
|
||||
- **Run locally (Docker)**:
|
||||
- Build site: `pnpm build`.
|
||||
- Image: `pnpm docker:build` (or `docker build --platform linux/amd64 -t git.mifi.dev/mifi-holdings/landing:latest .`).
|
||||
- Run: use `docker-compose up` **only** on a host that has `marina-net` and Traefik; otherwise run the image with a port map and open `http://localhost:<port>`.
|
||||
- Build site: `pnpm build`.
|
||||
- Image: `pnpm docker:build` (or `docker build --platform linux/amd64 -t git.mifi.dev/mifi-holdings/landing:latest .`).
|
||||
- Run: use `docker-compose up` **only** on a host that has `marina-net` and Traefik; otherwise run the image with a port map and open `http://localhost:<port>`.
|
||||
|
||||
No dev server; edit `src/` and run `pnpm build` (and optionally `docker run` or a local static server on `dist/`) to test.
|
||||
|
||||
@@ -114,16 +114,16 @@ No dev server; edit `src/` and run `pnpm build` (and optionally `docker run` or
|
||||
Three pipelines:
|
||||
|
||||
1. **ci** (`.woodpecker/ci.yml`)
|
||||
- **When**: Every PR and every push to `main`.
|
||||
- **Steps**: Install deps → Prettier format check → lint (ESLint, Stylelint, yamllint) → **Build** (`pnpm build`). Mattermost notifications on success/failure.
|
||||
- **When**: Every PR and every push to `main`.
|
||||
- **Steps**: Install deps → Prettier format check → lint (ESLint, Stylelint, yamllint) → **Build** (`pnpm build`). Mattermost notifications on success/failure.
|
||||
|
||||
2. **build** (`.woodpecker/build.yml`)
|
||||
- **When**: Push/tag/manual on `main` (and deployment to production); **depends_on: ci**.
|
||||
- **Steps**: **Site build** (`pnpm install`, `pnpm build`) → Docker image build (linux/amd64, up to 3 retries) → push `:latest` and `:<CI_COMMIT_SHA>` to `git.mifi.dev/mifi-holdings/landing`. Mattermost notifications.
|
||||
- **When**: Push/tag/manual on `main` (and deployment to production); **depends_on: ci**.
|
||||
- **Steps**: **Site build** (`pnpm install`, `pnpm build`) → Docker image build (linux/amd64, up to 3 retries) → push `:latest` and `:<CI_COMMIT_SHA>` to `git.mifi.dev/mifi-holdings/landing`. Mattermost notifications.
|
||||
|
||||
3. **deploy** (`.woodpecker/deploy.yml`)
|
||||
- **When**: Same as build (main / production deploy); **depends_on: ci**.
|
||||
- **Steps**: Call Portainer webhook to redeploy the stack. Mattermost notifications.
|
||||
- **When**: Same as build (main / production deploy); **depends_on: ci**.
|
||||
- **Steps**: Call Portainer webhook to redeploy the stack. Mattermost notifications.
|
||||
|
||||
Secrets used: `gitea_registry_username`, `gitea_package_token`, `portainer_webhook_url`, `mattermost_*` (bot token, channel IDs, API URL).
|
||||
|
||||
@@ -134,11 +134,11 @@ Secrets used: `gitea_registry_username`, `gitea_package_token`, `portainer_webho
|
||||
- **Orchestration**: Stack defined in `docker-compose.yml`, deployed via **Portainer** (webhook triggered by Woodpecker deploy pipeline).
|
||||
- **Network**: Container joins external network `marina-net` (shared with Traefik).
|
||||
- **Traefik**:
|
||||
- Hosts: `mifi.holdings`, `www.mifi.holdings`.
|
||||
- Entrypoint: `websecure` (HTTPS).
|
||||
- TLS: Let's Encrypt (`tls.certresolver=letsencrypt`).
|
||||
- Middleware: `security-prison@file`.
|
||||
- Backend: this service, port 80.
|
||||
- Hosts: `mifi.holdings`, `www.mifi.holdings`.
|
||||
- Entrypoint: `websecure` (HTTPS).
|
||||
- TLS: Let's Encrypt (`tls.certresolver=letsencrypt`).
|
||||
- Middleware: `security-prison@file`.
|
||||
- Backend: this service, port 80.
|
||||
- **Healthcheck**: `wget --spider -q http://localhost/` every 20s (timeout 3s, 3 retries).
|
||||
|
||||
To deploy manually: pull the latest image and redeploy the stack in Portainer, or trigger the Portainer webhook (e.g. same URL as in `portainer_webhook_url`).
|
||||
|
||||
Reference in New Issue
Block a user