This repo holds the core files for building the Technology & Diversity Statistics webpage.
You can find the page here:
https://ministryofjustice.github.io/technology-diversity-statistics/
The idea behind this project is to use as little code as possible to provide a simple development experience whilst also achieving an exemplary result for the end user.
The approach has led to the creation of an automated development and deployment system. This system uses Docker to achieve a simple and effective development environment and a GitHub Action to perform continuous integration (CI) tasks.
The following software must be available locally:
Open your terminal and run the following chained command. It will change to your home directory before cloning and build occurs.
cd ~ && git clone https://github.com/ministryofjustice/technology-diversity-statistics.git && cd technology-diversity-statistics && make build && make launch
-
Clone this repo to your local machine and change directories.
git clone https://github.com/ministryofjustice/technology-diversity-statistics.git cd technology-diversity-statistics
-
Build the project locally. This will bring in all required development libraries.
make build
-
Build and run the docker image. Once Docker is running the site will automatically launch in your web browser. The terminal will complete by beginning a 'watch' session to monitor asset changes; assets will be compiled.
make launch
For more detail please view the make
commands glossary below.
Building a GitHub page has been made simple by using an action as our build service.
A build will trigger once a commit has been either pushed or merged (PR) into the main branch or, the action gets triggered manually from the Actions tab. The following will take place:
- GitHub Action begins background tasks:
- Install all required packages
npm install
- Build css/js files and introduce libraries
npm run build
(laravel mix) - Stage files from the
dist/
directory - Commit staged files
- Push new site files to the orphaned
gh-pages
branch - GitHub Pages rebuild and publish gets triggered by previous push
- Install all required packages
There are several make
commands configured in the Makefile
. These are mostly just convenience wrappers for longer or more complicated commands.