Commit Graph

28 Commits

Author SHA1 Message Date
Jack Carter
2a02ce7edd ci: harden the build and API-pages workflows (#843)
* ci: serialise image builds and stop the API-pages workflow clobbering the lockfile

build_n_push: add a per-ref concurrency group so two quick merges to main can't race the :main tag (last push wins regardless of commit order, and the server auto-pulls :main); add permissions: contents: read; validate .dockerignore and package.json changes in the PR path filter.

generate_api_pages: pin Node 20 and switch npm install -> npm ci so the run can never rewrite the now-tracked package-lock.json with a divergent macOS-resolved tree; stage only src/pages/ipa/resources instead of git add -A; drop --force from the push — a force-push from this workflow would silently rewrite main and destroy any PR merged since its checkout.

* chore: warn when per-page dates are skipped; drop dead per-file git lookup

buildGitDateMap now logs a warning when it emits no dates (git missing or shallow clone) instead of silently blanking every page's Updated line and the sitemap lastmod entries; document the squash-merge assumption behind the --name-only walk. Remove the unused getGitLastModified. Note in CLAUDE.md that npm run start warns under output: 'standalone'. Gen output verified byte-identical.

* ci: self-heal the API-pages push when main moves mid-run

Rebase the single generated-files commit onto the moved branch before pushing, so a PR merged during the multi-minute run no longer rejects the push (the failure --force was presumably papering over). A genuine conflict — a concurrent edit of the generated files themselves — still fails the run loudly with main untouched. Also serialise dispatches with a concurrency group: run history shows several same-day dispatches, and overlapping runs regenerate the same files.

Sandbox-tested against a bare repo: plain push rejected on race; rebase+push lands with both commits intact; true conflict exits 1 leaving the branch tip untouched.

* ci: sync to branch tip before regenerating API pages

A run queued behind another checks out the commit pinned at its dispatch time; regenerating against that stale base means the pre-push rebase replays a snapshot diff, and a file the newer spec removed can silently survive from the prior run. Fetch + reset to the branch tip before generating so the diff is computed against reality. Also note the latest-dispatched-vs-newest-tag caveat on the concurrency comment.

Sandbox-proven: with the old order a removed-in-newer-spec file survives the rebase replay; with sync-first it is gone.

* Prevent stale workflows from overwriting newer published content

* Coderabbit Fix

---------

Co-authored-by: Brandon Hopkins <brandon@techhut.tv>
2026-07-22 17:06:58 +02:00
Jack Carter
76845ec77f perf: build docs on the CI runner with a warm .next cache (#840)
Move `npm run build` out of the Docker image onto the runner, where actions/cache persists .next/cache across runs (the in-Docker build discarded it every time). The image now just packages the prebuilt .next and serves it with `next start`; runtime and the DocSearch entrypoint injection are unchanged.

Also: checkout full history (fetch-depth: 0) so per-page dates are correct, guard buildGitDateMap against shallow clones (correct-or-absent, never wrong), modernise the Docker actions (build-push-action v6, provenance: false), and add a path-filtered pull_request trigger so pipeline changes are validated before merge.

Smoke-tested via isolated build + docker run: serves /, /introduction, /api, sitemap, static assets (200); DocSearch placeholder injection intact.
2026-07-09 14:13:30 +02:00
Jack Carter
51afd0cf71 build: use npm ci for clean, reproducible installs (#839)
Switch pr-build and the Docker image from `npm install` to `npm ci` (`npm ci --omit=dev` in the image), and enable setup-node's npm cache. Deterministic installs from the committed lockfile; CI now fails fast on an out-of-sync lockfile.

Depends on the lockfile being tracked (PR #838) — npm ci requires a committed package-lock.json.
2026-07-09 13:19:31 +02:00
Jack Carter
b968695737 ci: validate PRs with build and MDX heading linter (#743)
* ci: validate PRs with build and MDX heading linter

Adds a pull_request workflow running npm run lint:mdx, npm run build,
and npm run lint so heading-hierarchy bugs and broken builds get caught
before merge rather than after.

The new linter (scripts/lint-mdx-headings.mjs) enforces that the first
heading is h1 and that heading levels never jump by more than one. Also
fixes three existing pages that had no h1 title — two were using a
legacy export const title pattern, one was missing a title entirely.

* ci: use npm install since lockfile is gitignored

package-lock.json is in .gitignore, so npm ci and setup-node's npm
cache both fail on a fresh CI checkout. Match the Dockerfile pattern
(npm install, no cache) instead.

* ci: drop ESLint step; project config is broken

`npm run lint` fails with 'Converting circular structure to JSON'
under ESLint 9.x — the repo has no .eslintrc or eslint.config file,
so the legacy resolver hits the React plugin's circular reference.
This is pre-existing (build_n_push.yml never ran lint, so it stayed
hidden); fixing it needs flat-config migration and is out of scope.
Drop the step until that lands.
2026-05-12 15:18:07 +02:00
Maycon Santos
27e4500def add force push for docs workflow 2026-03-11 19:55:32 +01:00
Maycon Santos
ec76ca2524 Update checkout and setup-go actions (#531) 2025-12-30 10:37:30 +01:00
Eduard Gert
7eb683f617 Add deploy workflow (#472)
* Add deploy workflow

* Update hostname
2025-11-12 15:00:29 +01:00
Pascal Fischer
5232d9442c update openapi source file location (#408) 2025-08-07 14:08:57 +02:00
Maycon Santos
2a3e25ec94 update debug bundle text (#322)
* update debug bundle text

* update
2025-05-27 15:20:54 +02:00
Maycon Santos
09537916e4 Update Authentik doc with disable login var (#307)
* Update Authentik doc with disable login var

* fix linter
2025-04-11 13:54:00 +02:00
Maycon Santos
17fb9602d3 Update docker creds (#239) 2024-09-30 20:07:10 +02:00
pascal-fischer
e8d741b0bd Extend api gen flow to delete old pages (#191) 2024-05-16 12:43:41 +02:00
pascal-fischer
503696de09 Update api generation workflow (#190) 2024-05-15 21:47:49 +02:00
pascal-fischer
a3eb5be0f8 fix the api and disable the automation (#172) 2024-03-19 10:13:43 +01:00
Zoltan Papp
d19c0da982 Add troubleshooting page (#136)
---------

Co-authored-by: Maycon Santos <mlsmaycon@gmail.com>
2024-01-30 13:56:19 +01:00
Maycon Santos
ceddc4b1fc Use bot token on checkout step (#113) 2023-12-07 18:02:58 +01:00
pascal-fischer
65d4119e42 Add explicit java version setup (#110)
* add java setup and add some code to test

* Update API pages with v0.24.3

* removing test code

---------

Co-authored-by: netbirddev <dev@netbird.io>
2023-11-24 15:11:11 +01:00
Maycon Santos
af5479f041 Update build_n_push.yml with workflow_dispatch 2023-08-14 12:02:38 +02:00
Maycon Santos
36496e81a6 Update generate_api_pages.yml 2023-08-11 14:57:13 +02:00
Maycon Santos
ceb5ba0342 Update generate_api_pages.yml 2023-08-10 16:22:15 +02:00
Maycon Santos
734cc3dfb2 Check for diff and force push (#78)
check for diff before trying to commit

force push to protected branch

---------

Co-authored-by: DevBot NetBird <dev@netbird.io>
2023-08-05 00:26:09 +02:00
Maycon Santos
f45200a234 Update packages domain (#75)
* Update packages domain

* update committer info

* replace wiretrustee
2023-07-28 15:16:06 +02:00
Pascal Fischer
c25f35b422 add missing npm install command to docs flow 2023-06-17 12:37:30 +02:00
Pascal Fischer
fcaeda9864 remove ifs from api generation workflow 2023-06-12 17:02:09 +02:00
pascal-fischer
d18f5c076f Decouple api generation flow from docker build (#62)
* decouple api generation from docker build

* add different PAT
2023-06-12 14:47:20 +02:00
pascal-fischer
f33b4df3dd Add workflow for api gen and refactor genration script (#60)
* update gitignore

* add first version of api generation flow

* try to run flow

* testing flow

* update gen flow

* switch flow to macOS

* fix

* add npm install

* test workflow

* Update API pages

* test workflow with current main

* refactor parser

* merge examples and schema functions

* merge examples and schema functions

* merge parameters as well

* revert template to single class component

* update account

* finalizing

* update with the newest version of openapi

* full flow

* update

* add docker command

* split flow in two jobs

* remove testing trigger

---------

Co-authored-by: GitHub Actions <no-reply@github.com>
2023-06-05 09:35:54 +02:00
mlsmaycon
f5146c7455 Run ci/cd on PRs 2022-06-20 19:12:43 +02:00
mlsmaycon
98751bc1f4 Move the documentation repository to a public repo
Added a LICENSE and documentation on how to contribute

Updated CI/CD to use the root level code
2022-06-20 19:05:25 +02:00