Skip to content

Commit 7ccbab9

Browse files
authored
Merge pull request #14 from LBHackney-IT/one-ring-to-rule-them-all
Use Docusaurus to build
2 parents 8992d63 + 4da87c2 commit 7ccbab9

File tree

347 files changed

+37431
-416
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

347 files changed

+37431
-416
lines changed

.editorconfig

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# EditorConfig ensures consistency: https://editorconfig.org
2+
# Plugins are available for all good editors (and even some
3+
# bad ones)
4+
#
5+
# VSCode plugin: https://marketplace.visualstudio.com/items?itemName=EditorConfig.EditorConfig
6+
7+
# This is the top-most editorconfig file for the repository
8+
root = true
9+
10+
# Unix-style newlines with a newline ending every file
11+
[*]
12+
end_of_line = lf
13+
insert_final_newline = true
14+
trim_trailing_whitespace = true
15+
charset = utf-8
16+
17+
# Opinionated tab/space rules, matching the Docusaurus defaults.
18+
indent_style = space
19+
indent_size = 2

.github/CODEOWNERS

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# The default owners for are the Hackney development team, and more specialised
2+
# ownership can be added to directories/folders as needed.
3+
#
4+
# Note that order matters: more specific rules lower in this file will override
5+
# the default, NOT add to it
6+
7+
* @LBHackney-IT/development-team

.github/workflows/deploy.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
# Runs on pushes targeting the default branch
5+
push:
6+
branches: [$default-branch]
7+
8+
# Allows you to run this workflow manually from the Actions tab
9+
workflow_dispatch:
10+
11+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
12+
permissions:
13+
contents: read
14+
pages: write
15+
id-token: write
16+
17+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
18+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
19+
concurrency:
20+
group: "pages"
21+
cancel-in-progress: false
22+
23+
24+
jobs:
25+
build:
26+
name: Deploy to GitHub Pages
27+
runs-on: ubuntu-latest
28+
steps:
29+
- uses: actions/checkout@v4
30+
- uses: actions/setup-node@v4
31+
with:
32+
node-version: 22
33+
cache: npm
34+
- name: Setup Pages
35+
id: pages
36+
uses: actions/configure-pages@v5
37+
# with:
38+
# Automatically inject pathPrefix in your Gatsby configuration file.
39+
#
40+
# You may remove this line if you want to manage the configuration yourself.
41+
# static_site_generator: gatsby
42+
# - name: Restore cache
43+
# uses: actions/cache@v4
44+
# with:
45+
# path: |
46+
# static
47+
# .cache
48+
# key: ${{ runner.os }}-docusaurus-build-${{ hashFiles('static') }}
49+
# restore-keys: |
50+
# ${{ runner.os }}-docusaurus-build-
51+
- name: Install dependencies
52+
run: npm ci
53+
- name: Build with Docusaurus
54+
run: npm run build
55+
- name: Upload artifact
56+
uses: actions/upload-pages-artifact@v3
57+
with:
58+
path: ./build
59+
60+
# Deployment job
61+
deploy:
62+
environment:
63+
name: github-pages
64+
url: ${{ steps.deployment.outputs.page_url }}
65+
runs-on: ubuntu-latest
66+
needs: build
67+
steps:
68+
- name: Deploy to GitHub Pages
69+
id: deployment
70+
uses: actions/deploy-pages@v4
71+

.github/workflows/test-build.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Test deployment
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
# Review gh actions docs if you want to further define triggers, paths, etc
8+
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on
9+
10+
jobs:
11+
test-deploy:
12+
name: Test deployment
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
- uses: actions/setup-node@v4
17+
with:
18+
node-version: 22
19+
cache: npm
20+
21+
- name: Install dependencies
22+
run: npm install
23+
- name: Test build website
24+
run: npm run build

.gitignore

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
1-
# See http://help.github.com/ignore-files/ for more about ignoring files.
2-
#
3-
# If you find yourself ignoring temporary files generated by your text editor
4-
# or operating system, you probably want to add a global ignore instead:
5-
# git config --global core.excludesfile ~/.gitignore_global
1+
# Dependencies
2+
/node_modules
63

7-
# Ignore bundler config
8-
/.bundle
9-
10-
# Ignore the build directory
4+
# Production
115
/build
126

13-
# Ignore cache
14-
/.sass-cache
15-
/.cache
7+
# Generated files
8+
.docusaurus
9+
.cache-loader
10+
11+
# Misc
12+
.DS_Store
13+
.env.local
14+
.env.development.local
15+
.env.test.local
16+
.env.production.local
1617

17-
# Ignore .DS_store file
18-
.DS_Store
18+
npm-debug.log*
19+
yarn-debug.log*
20+
yarn-error.log*

CONTRIBUTING.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# How to contribute to this site
2+
3+
This website is built using [Docusaurus](https://docusaurus.io/) and is hosted on GitHub Pages using GitHub Actions to build and publish.
4+
5+
6+
## Getting set up
7+
8+
### Prerequisites
9+
10+
You'll need the following to run the site locally and make changes easily:
11+
12+
1. Modern Node (check the `node-version` in [the deployment pipeline](./.github/workflows/deploy.yml) to see what we're targeting).
13+
2. [EditorConfig](https://editorconfig.org/) configured for your editor (optional). EditorConfig ensures your changes are consistent with the repository standards before you raise a pull request.
14+
15+
> ℹ️ For VSCode there's an official [EditorConfig for VS Code](https://marketplace.visualstudio.com/items?itemName=EditorConfig.EditorConfig) plugin.
16+
17+
18+
### Install dependencies
19+
20+
```bash
21+
npm install
22+
```
23+
24+
## Local Development
25+
26+
```bash
27+
npm start
28+
```
29+
30+
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
31+
32+
> ⚠️ The local development server doesn't build the search index. To test this locally, you'll need to build and serve the site (see below).
33+
34+
## Build
35+
36+
```bash
37+
npm run build
38+
```
39+
40+
This command generates static content into the `build` directory and can be served using any static contents hosting service or using:
41+
42+
```bash
43+
npm run serve
44+
```
45+
46+
## Deployment
47+
48+
Deployment is done automatically through GitHub Actions to GitHub Pages.
49+
50+
### Break-glass deployment steps
51+
52+
Using SSH:
53+
54+
```bash
55+
USE_SSH=true npm run deploy
56+
```
57+
58+
Not using SSH:
59+
60+
```bash
61+
GIT_USER=<Your GitHub username> npm run deploy
62+
```

LICENSE

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
Copyright 2024 London Borough of Hackney
2+
3+
## Source code
4+
5+
Source code for the site (excluding the published content) is provided under the MIT License:
6+
7+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
8+
9+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
10+
11+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
12+
13+
## Published site content
14+
15+
The written contents of the site, including code snippets held therein, are released under the [Open Government Licence](https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/).

README.md

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,35 @@
1-
# Hackney Development System Homepage
1+
# Hackney Development System
22

3-
This repo contains the homepage for the [Hackney Development System site](playbook.hackney.gov.uk)!
3+
The [Hackney Development System](https://playbook.hackney.gov.uk/) is the home of the Hackney development team's documentation, and details how we work as well as technical and architectural documentation.
4+
5+
Project-specific documentation doesn't generally live here, and will be found alongside the code in the relevant repositories. There are exceptions, for example the API specifications section seeks to provide a central directory of Hackney's APIs.
6+
7+
## Architecture
8+
9+
This website is built using [Docusaurus](https://docusaurus.io/) and is hosted on GitHub Pages using GitHub Actions to build and publish.
10+
11+
Before 2024 this site was built and deployed as a series of small static sites with independent repositories, build tooling, and styling.
12+
13+
The site is now a single repository and build pipeline, which reduces the maintenance burden to upgrade dependencies and gives us more flexibility to alter and add to the structure.
14+
15+
### Local search
16+
17+
This site provides a search bar provided by an in-browser JavaScript library. This differs from the Docusaurus-supported default which relies on an Algolia account. We choose local-only search so we don't have to manage the Algolia account or rely on a third party service.
18+
19+
### Google Analytics
20+
21+
In order to measure the effectiveness of our documentation and identify stale or ineffective content we use Google Analytics, which records to a property in our Google Workspace.
22+
23+
### Ownership
24+
25+
Most of the content on this site belongs to Hackney's development community as a whole. Some sections, for example the Data Platform Playbook, belong to another group
26+
27+
We use [CODEOWNERS](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners) to ensure the relevant owner approves a change before it can be merged.
28+
29+
### Deployment
30+
31+
The default branch of the repository is automatically built and deployed as a GitHub Pages site, using GitHub Actions. The deployment and test workflows are in [`.github/workflows/`](.github/workflows/).
432

533
## Contributing
6-
To make / preview changes, simply open the `index.html` file in your browser.
7-
Once your changes are complete, raise a PR. You must have at least one approval before you merge your PR.
8-
Upon merging, your changes will be deployed through our automated pipeline!
34+
35+
Pull requeststs are welcome! See [CONTRIBUTING.md](./CONTRIBUTING.md) for details on how to run the site locally and make changes.

babel.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
3+
};

contact-us.html

Lines changed: 0 additions & 76 deletions
This file was deleted.

0 commit comments

Comments
 (0)