Skip to content

Latest commit

 

History

History
68 lines (45 loc) · 2.48 KB

deployment.md

File metadata and controls

68 lines (45 loc) · 2.48 KB

Deployment

The Design System is a static site which is generated by Metalsmith and hosted on Netlify.

Netlify runs npm run build and deploys the contents of the build directory.

This deployment happens outside of GitHub Actions, which means that deploys happen in parallel with the tests running. However, Netlify will only deploy if the build executes successfully.

DNS for the design-system.service.gov.uk domain is managed via Netlify.

Production

Whenever the main branch changes, the site is built and deployed to design-system.service.gov.uk.

Pull Request previews

Previews of Pull Requests are automatically published to a URL which has the prefix deploy-preview followed by the identifier number of the pull request.

For example, pull request #137 would be deployed to deploy-preview-137--govuk-design-system-preview.netlify.com.

The Netlify bot should comment on each PR shortly after building with a link to the preview.

Branch previews

When a new branch is pushed to GitHub a preview website will be deployed. Branch deploys are published to a URL which includes the branch name as a prefix.

For example, if a branch is called staging, it will deploy to staging--govuk-design-system-preview.netlify.com.

History

Hosting on PaaS

From launch until December 2023, the Design System was hosted on PaaS.

Proxying on GOV.UK

We explored hosting the Design System on gov.uk/design-system by configuring the Design System as a backend and route on GOV.UK's router.

This was abandoned because GOV.UK consistently does not use trailing slashes and is [configured at the caching layer to strip them out][varnish-strip], whilst the Design System consistently uses trailing slashes and nginx by default will automatically redirect to add them (because that's how static sites and directories with index files work). This caused an infinite redirect.

We considered changing the nginx configuration to match the behaviour of GOV.UK but decided against it because:

  • we would not be able to match this behaviour on other services we use, such as Netlify.
  • it would break relative URLs.

We considered modifying the caching layer to allow the Design System to keep its trailing-slashed URLs, but decided against it because:

  • it introduced a 'special case' and additional complexity to GOV.UK's configuration.
  • other parts of GOV.UK's infrastructure (such as their mirroring) make assumptions based on the lack of a trailing slash and relative URLs.