One place for service teams to find styles, components and patterns for designing government services.
You'll need Git and Node.js installed to get this project running.
Note: You will need the active LTS (Long-term support) Node.js version for this project (as specified in .nvmrc)
If you're an external contributor make sure to fork this project first
git clone [email protected]:alphagov/govuk-design-system.git # or clone your own fork
cd govuk-design-system
If you work across multiple Node.js projects there's a good chance they require different Node.js and npm versions.
To enable this we use nvm (Node Version Manager) to switch between versions easily.
- install nvm
- Run
nvm install
in the project directory (this will use .nvmrc)
npm install
This will build sources, serve pages and watch for changes.
npm start
Build ./src
to ./deploy/public
npm run build
We are using the sass-lint plugin to lint the Sass files in
source/stylesheets
. You can run the linter from command line by running:
npm run lint
Design System consumes GOV.UK Frontend packages via NPM. These are defined in the package.json file.
NOTE: For the time being we are consuming private packages. To access private packages, you will first need to log in to NPM with
npm login
We're using GOV.UK PaaS for automated checks and production deployment.
When changes are pushed to GitHub Travis will:
- run the tests
- lint the Sass stylesheets in
source/stylesheets
- run the
npm run build
command to ensure that the site can be generated
If any of these fail, this will be reported in the GitHub status checks interface.
We're using Netlify to automate our deployment for development preview.
The master branch is published to govuk-design-system-preview.netlify.com
.
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
.
When a new pull request is raised a preview website will be deployed.
A deploy generated from a pull request will building the site as it would be if the proposed changes were merged. Deploy Previews are published to a URL which has the prefix deploy-preview
followed by the identifier number of the pull request.
For example, pull request #137 will automatically trigger a Deploy Preview at deploy-preview-137--govuk-design-system-preview.netlify.com
. You will also be able to access the deploy preview URL from the govuk-design-system-ci's comment.