build-process.md (2325B)
1 --- 2 label: How the Build Works 3 icon: gear 4 order: 770 5 --- 6 7 # How the Build Works 8 9 `build.sh` runs the whole pipeline, driven by GitHub Actions. Here's what it does, step by step. 10 11 ## 1. Setup & metadata 12 13 - Detects the repo owner (`GITHUB_REPOSITORY_OWNER`, falling back to `notamitgamer` locally) 14 - Resolves the site's base URL from a configured Pages CNAME, or falls back to `https://<username>.github.io` 15 - Captures the git-mirror repo's own commit hash and build timestamp for the footer 16 17 ## 2. Copy root assets 18 19 `style.css`, `favicon.png`, `logo.png`, and `icon.png` are copied from `assets/` into the site root (with `favicon.png` also duplicated as `favicon.ico`). 20 21 ## 3. Fetch & process each public repository 22 23 For every public repo (minus the filtered ones): 24 25 1. Clone it as a **bare repo** into `raw_repos/` 26 2. Overwrite stagit's placeholder `description` and `owner` files 27 3. Run `stagit` to generate the standard Log / Files / Refs / README / LICENSE pages 28 4. Copy `style.css`, `logo.png`, and `favicon.png` into that repo's subfolder 29 5. Inject an **Activity** link into stagit's nav bar on every generated page 30 6. Generate a custom `activity.html` page with: 31 - Clone URL and GitHub link 32 - Last commit hash + timestamp 33 - Approximate repo size 34 - A small dependency-free SVG bar graph of weekly commit activity 35 7. Inject a recursive, collapsible **folder tree** script into `files.html`, with hash-based URLs (`#folder=path/to/dir`) so specific folders can be linked directly and auto-expanded 36 8. Add a static **breadcrumb** to every individual file page under `file/`, built by walking the file's path 37 9. Write a `last_commit` file into the repo subfolder recording the mirror's build metadata 38 39 ## 4. Generate the central index 40 41 `stagit-index` runs over all the bare repos to produce the root `site/index.html` landing page, listing every mirrored repository. 42 43 ## 5. Site-wide finishing touches 44 45 - Injects a formatted build-info footer (owner, build time, git-mirror commit, stagit credit) into every generated HTML page 46 - Copies `CNAME` into the site output, if present 47 - Injects a mobile viewport meta tag into every page's `<head>` 48 - Generates `sitemap.xml` from every HTML file in the output 49 - Generates a styled `404.html` 50 51 The final output lands in `./site`, ready to be deployed via GitHub Pages.