Skip to content
This repository has been archived by the owner on Nov 6, 2024. It is now read-only.

The service manual for the Continuing Professional Development Services

License

Notifications You must be signed in to change notification settings

DFE-Digital/cpd-service-manual

Repository files navigation

CPD Service manual

How we build and operate products at the Department for Education. This repo is inspired by (and steals shamelessly from) the GDS Way and the Ministry of Justice Technical Guidance.

It's built using the GOV.UK tech-docs-template, and hosted on GOV.UK PaaS.

Getting started

To preview the site locally, we need to use the terminal.

Install Ruby and Bundler, preferably with a Ruby version manager.

Once you have Ruby and Bundler set up, you can install this project's dependencies by running the following in this directory:

bundle

This will install all required dependencies, including the govuk-tech-docs gem and middleman.

Making documentation changes

To make changes edit the source files in the source folder.

Make sure to make changes in a branch, and issue a pull request when you want them to be reviewed and published.

Running feature tests

This source repository comes with a suite of Capybara feature tests allowing the content of the site to be validated for changes.

The snapshots that are compared against are stored within spec/support/features/snapshots.

To run the feature tests just call

bundle exec rspec

If the changes detected are expected then simply delete the existing snapshot from spec/support/features/snapshots and rerun the tests. You should always commit updated snapshot files so that other can test against your changes.

Previewing

Whilst writing documentation we can run a middleman server to preview how the published version will look in the browser. After saving a change the preview in the browser will automatically refresh.

The preview is only available on our own computer. Others will not be able to access it if they are given the link.

Type the following to start the server:

bundle exec middleman server

If all goes well something like the following output will be displayed:

== The Middleman is loading
== LiveReload accepting connections from ws://192.168.0.8:35729
== View your site at "http://Laptop.local:4567", "http://192.168.0.8:4567"
== Inspect your site configuration at "http://Laptop.local:4567/__middleman", "http://192.168.0.8:4567/__middleman"

You should now be able to view a live preview at http://localhost:4567.

Publishing changes

Every change should be reviewed in a pull request, no matter how minor, and we've enabled branch protection to enforce this.

Once the pull request is merged, the deploy Github action workflow runs the build and pushes the static site to GOV.UK PaaS.

Review apps

Every pull request builds a separate review app. It is a unique version of the documentation implementing the changes from the pull request and pushed to GOV.UK PaaS with a unique URL so it can be shared and peer reviewed. The URL is posted in a comment on the pull request.

Any change to the branch is automatically pushed to the review app after a few minutes.

When the pull request is closed or merged, the review app is deleted.

GOV.UK PaaS set-up

The application is called cpd-service-manual and is supported by the Staticfile buildpack . It is deployed in the space early-careers-framework-prod, in the dfe organisation.

The custom domain, SSL certificate and CDN are provided by the cpd-service-manual cdn-route service.

The deploy workflow connects to paas using service account technical-architecture-paas@digital.education.gov.uk (a Google group).

The review apps are deployed to the early-careers-framework-dev space and their name is suffixed by the PR number. There is no cdn-route service, we simply use the default .london.cloudapps.digital domain.

Licence

The documentation is © Crown copyright and available under the terms of the Open Government 3.0 licence.