Skip to content

Commit

Permalink
Update template resources
Browse files Browse the repository at this point in the history
Signed-off-by: GitHub <noreply@github.com>
  • Loading branch information
Jacob Woffenden authored Apr 16, 2024
1 parent 5dd0711 commit 424ef86
Show file tree
Hide file tree
Showing 14 changed files with 116 additions and 135 deletions.
8 changes: 2 additions & 6 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

---
version: 2

updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
time: "09:00" # UTC
44 changes: 44 additions & 0 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
name: Build and Test

on:
pull_request:
branches:
- main

permissions: {}

jobs:
build:
name: Build
runs-on: ubuntu-latest
container:
image: docker.io/ministryofjustice/tech-docs-github-pages-publisher@sha256:cd3513beca3fcaf5dd34cbe81a33b3ff30337d8ada5869b40a6454c21d6f7684 # v4.0.0
permissions:
contents: read
steps:
- name: Checkout
id: checkout
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2

- name: Build
id: build
run: |
/usr/local/bin/package
test:
name: Test
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
id: checkout
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2

- name: Lychee
id: lychee
uses: lycheeverse/lychee-action@c053181aa0c3d17606addfe97a9075a32723548a # v1.9.3
with:
args: --verbose --no-progress './**/*.md' './**/*.html' './**/*.erb' --accept 403,200,429
fail: true
17 changes: 0 additions & 17 deletions .github/workflows/check-links.yml

This file was deleted.

25 changes: 16 additions & 9 deletions .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,28 @@
# Need a GitHub Advanced Security license to run this action on private repos.

---
name: Dependency Review

on:
pull_request:
types: [opened, edited, reopened, synchronize]
types:
- edited
- opened
- reopened
- synchronize

permissions:
contents: read
permissions: {}

jobs:
dependency-review:
name: Dependency Review
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Checkout
id: checkout
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2

- name: Dependency Review
uses: actions/dependency-review-action@v3
uses: actions/dependency-review-action@9129d7d40b8c12c1ed0f60400d00c92d437adcce # v4.1.3
with:
# Possible values: critical, high, moderate, low
fail-on-severity: critical
14 changes: 0 additions & 14 deletions .github/workflows/format-code.yml

This file was deleted.

77 changes: 34 additions & 43 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,69 +1,60 @@
name: Publish gh-pages
---
name: Build and Publish

on:
workflow_dispatch:
push:
branches:
- "main"
paths-ignore:
- "docs/**"
- main

# GITHUB_TOKEN permissions to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
permissions: {}

# Allow one concurrent deployment
concurrency:
group: "pages"
group: github-pages
cancel-in-progress: true

jobs:
build:
name: Build
runs-on: ubuntu-latest
container:
image: ministryofjustice/tech-docs-github-pages-publisher:v3
image: docker.io/ministryofjustice/tech-docs-github-pages-publisher@sha256:cd3513beca3fcaf5dd34cbe81a33b3ff30337d8ada5869b40a6454c21d6f7684 # v4.0.0
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Compile Markdown to HTML and create artifact
id: checkout
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2

- name: Build
id: build
run: |
/scripts/deploy.sh
- name: Upload artifact to be published
uses: actions/upload-artifact@v3
/usr/local/bin/package
- name: Upload Artifact
id: upload_artifact
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
name: github-pages
path: artifact.tar
retention-days: 1
overwrite: true

deploy:
publish:
needs: build
name: Publish
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
url: ${{ steps.configure_pages.outputs.base_url }}
permissions:
contents: read
id-token: write
pages: write
steps:
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
- name: Configure Pages
id: configure_pages
uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5.0.0

url-check:
needs: deploy
runs-on: ubuntu-latest
steps:
- name: Download a Build Artifact from build
uses: actions/download-artifact@v3
with:
name: github-pages
path: github-pages
- name: Unpack files and check URL links
run: |
cd github-pages
tar -xvf artifact.tar
npm install linkinator
npx linkinator . --recurse --markdown \
--skip https://ministryofjustice.github.io/template-documentation-site/images/govuk-large.png \
# "URL Check will fail on private and internal GitHub repositories"
- name: Deploy to GitHub Pages
id: deploy_pages
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
.env
.terraform/
coverage/
venv/
env/
.DS_STORE
.vscode
*.code-workspace
*.sha256
terraform.tfstate
2 changes: 0 additions & 2 deletions Gemfile

This file was deleted.

16 changes: 0 additions & 16 deletions Gemfile.lock

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2022 Crown Copyright (Ministry of Justice)
Copyright (c) 2022 - 2024 Crown Copyright (Ministry of Justice)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![repo standards badge](https://img.shields.io/endpoint?labelColor=231f20&color=005ea5&style=for-the-badge&label=MoJ%20Compliant&url=https%3A%2F%2Foperations-engineering-reports.cloud-platform.service.justice.gov.uk%2Fapi%2Fv1%2Fcompliant_public_repositories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j+gbr5SemhqkyuzE8xau4MP865JvWNuj0b1YuqDkgvH2GkURfakly01Cg7Cw0+qyXxkjojq9Lw+vT2AUY+DlF/otYq1Ixc35re2V7R8aTRg2KUv7+ou3x/14PsUBn3NG51S0XpG0Z9PcOPKWSS0SKNUo9Rv2Mmt/G5WpPF6pHGra7Jv410OVsdaz217AbkAPX3ubkm240belCuudT4Rp5p/DyC2lf9mfq1iq5eFe8/lu+K0YrVp0uret4nAkwlB6vzjI/1PxrlrTp/oNHbzTJI92T1qAT+BfW49MhMg6JUp7ehY5a6Tl2jjmVvitF9fxo5Yq8CaAfAkzLMnySt6uz/1k6bPx59CpCNxGfoSKA30IPoH7cQXdArwCOllFX/i53P5P9a/gNkKpsCMFRuFAAAAABJRU5ErkJggg==)](https://operations-engineering-reports.cloud-platform.service.justice.gov.uk/public-github-repositories.html#template-documentation-site)

Use this repository template to create a documentation website using the GOV.UK [Technical Documentation Template](https://tdt-documentation.london.cloudapps.digital/) and its [source code](https://github.com/alphagov/tech-docs-template).
Use this repository template to create a documentation website using the GOV.UK [Technical Documentation Template](https://github.com/alphagov/tdt-documentation/) and its [source code](https://github.com/alphagov/tech-docs-template).

This is recommended for MOJ's technical documentation because:

Expand All @@ -12,7 +12,7 @@ This is recommended for MOJ's technical documentation because:

- Both engineers and non-technical people can write your documentation using the [‘docs as code’](https://technology.blog.gov.uk/2017/08/25/why-we-use-a-docs-as-code-approach-for-technical-documentation/) approach.

Publishing is done by the Github Action [publish.yml](.github/workflows/publish.yml) that makes use of [tech-docs-github-pages-publisher](https://github.com/ministryofjustice/tech-docs-github-pages-publisher) docker container.
Publishing is done by the Github Action [publish.yml](.github/workflows/publish.yml) that makes use of [tech-docs-github-pages-publisher](https://github.com/ministryofjustice/tech-docs-github-pages-publisher) container.

## To create a site

Expand Down
4 changes: 1 addition & 3 deletions config/tech-docs.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
# See the available options: https://tdt-documentation.london.cloudapps.digital/configure_project/global_configuration/#configure-your-documentation-site

# Host to use for canonical URL generation (without trailing slash)
host: https://ministryofjustice.github.io/template-documentation-site

# Header-related options
show_govuk_logo: true
show_govuk_logo: false
service_name: Template Documentation Site
service_link: /

Expand Down
27 changes: 6 additions & 21 deletions makefile
Original file line number Diff line number Diff line change
@@ -1,23 +1,8 @@
IMAGE := ministryofjustice/tech-docs-github-pages-publisher:v3

# Use this to run a local instance of the documentation site, while editing
.PHONY: preview check
IMAGE := docker.io/ministryofjustice/tech-docs-github-pages-publisher@sha256:cd3513beca3fcaf5dd34cbe81a33b3ff30337d8ada5869b40a6454c21d6f7684 # v4.0.0

preview:
docker run --rm \
-v $$(pwd)/config:/app/config \
-v $$(pwd)/source:/app/source \
-p 4567:4567 \
-it $(IMAGE) /scripts/preview.sh

deploy:
docker run --rm \
-v $$(pwd)/config:/app/config \
-v $$(pwd)/source:/app/source \
-it $(IMAGE) /scripts/deploy.sh

check:
docker run --rm \
-v $$(pwd)/config:/app/config \
-v $$(pwd)/source:/app/source \
-it $(IMAGE) /scripts/check-url-links.sh
docker run --rm -it \
--volume $$(pwd)/config:/app/config \
--volume $$(pwd)/source:/app/source \
--publish 4567:4567 \
$(IMAGE) /usr/local/bin/preview
2 changes: 1 addition & 1 deletion source/index.html.md.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: GOV.UK Documentation Example
title: Template Documentation Site
---

<!-- This means open the file documentation/index.html as the entry point -->
Expand Down

0 comments on commit 424ef86

Please sign in to comment.