This repository publishes a utility container for previewing and packaging GOV.UK's Technical Documentation Template.
The scripts have moved:
-
/scripts/deploy.sh
is now/usr/local/bin/package
-
/scripts/preview.sh
is now/usr/local/bin/preview
The scripts in the Docker container have changed.
scripts/deploy.sh
is now used to check internal links only during deployment. See .github/workflows/publish-gh-pages.yml
below.
If you see an error like this:
internally linking to ./*-communications-plan.html#tips-on-format-of-communications-examples; the file exists, but the hash 'tips-on-format-of-communications-examples' does not
You can override the check_interal_hash
argument with scripts/deploy.sh false
[Optional]: Use the scripts/check-url-links.sh
to test internal and external URLs. It may produce false errors for valid working URLs. Add the .github/workflows/check-links.yml
below to run the check when the PR is created. The false errors can be ignored.
[Optional]: Use the url-check
job within .github/workflows/publish-gh-pages.yml
to check the URLs are correct post-deployment. Private and internal Github repository URLs and other URLs that create false errors can be listed and skipped within this job.
If you have a branch called gh-pages already rename it to gh-pages-old. In repository settings, go to Pages, copy the 'Custom domain' value, and for 'Build and deployment' 'Source' change to the option 'GitHubs Actions'. Apply the yml code below to your CI Actions. If all is working you can remove the gh-pages-old branch. You may need to manually run the below workflow once it is merged into the main.
Examples of how to use the container can be found below:
To preview locally, you will need Docker, and then you can run the following:
docker run -it --rm \
--name tech-docs-github-pages-publisher \
--publish 4567:4567 \
--volume $(pwd)/config:/app/config \
--volume $(pwd)/source:/app/source \
ministryofjustice/tech-docs-github-pages-publisher:v4.0.0 /usr/local/bin/preview
Dependabot should take care of updating dependencies in Gemfile
and Gemfile.lock
.
However, if you need to update manually, you can do the following:
-
Build the image
docker build --file Dockerfile --tag ministryofjustice/tech-docs-github-pages-publisher:local .
-
Extract
Gemfile.lock
docker run -it --rm ministryofjustice/tech-docs-github-pages-publisher:local cat /opt/publisher/Gemfile.lock
-
Replace
Gemfile.lock
To create a new release:
-
Push to the main branch.
-
Create a new tag using
git tag vn.n.n
wheren.n.n
is the version number. Please follow semantic versioning. -
Push the tag to the remote repository using
git push origin --tags
. -
The "release" CICD pipeline is triggered, creating the release and performing the relevant docker actions.
To create a new release, follow GitHub's procedure