Skip to content

Commit

Permalink
i love tdt (#475)
Browse files Browse the repository at this point in the history
Signed-off-by: Jacob Woffenden <[email protected]>
  • Loading branch information
jacobwoffenden authored Dec 10, 2024
1 parent 5144bca commit 4779055
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 44 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: Build and Publish
name: 🚀 Publish

on:
push:
Expand All @@ -17,13 +17,13 @@ jobs:
name: Build
runs-on: ubuntu-latest
container:
image: docker.io/ministryofjustice/tech-docs-github-pages-publisher@sha256:cd3513beca3fcaf5dd34cbe81a33b3ff30337d8ada5869b40a6454c21d6f7684 # v4.0.0
image: ghcr.io/ministryofjustice/tech-docs-github-pages-publisher@sha256:aee182dd1dd86696077ea1c3512590f17ceb9f7a47aa5b16ea4f742666911dbd # v5.0.1
permissions:
contents: read
steps:
- name: Checkout
id: checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Build
id: build
Expand All @@ -32,7 +32,7 @@ jobs:
- name: Upload Artifact
id: upload_artifact
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: github-pages
path: artifact.tar
Expand All @@ -53,8 +53,8 @@ jobs:
steps:
- name: Configure Pages
id: configure_pages
uses: actions/configure-pages@1f0c5cde4bc74cd7e1254d0cb4de8d49e9068c7d # v4.0.0
uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5.0.0

- name: Deploy to GitHub Pages
id: deploy_pages
uses: actions/deploy-pages@decdde0ac072f6dcbe43649d82d9c635fff5b4e4 # v4.0.4
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: Build and Test
name: 🧪 Test

on:
pull_request:
Expand All @@ -13,33 +13,33 @@ jobs:
name: Build
runs-on: ubuntu-latest
container:
image: docker.io/ministryofjustice/tech-docs-github-pages-publisher@sha256:cd3513beca3fcaf5dd34cbe81a33b3ff30337d8ada5869b40a6454c21d6f7684 # v4.0.0
image: ghcr.io/ministryofjustice/tech-docs-github-pages-publisher@sha256:aee182dd1dd86696077ea1c3512590f17ceb9f7a47aa5b16ea4f742666911dbd # v5.0.1
permissions:
contents: read
steps:
- name: Checkout
id: checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Build
id: build
run: |
/usr/local/bin/package
# @jacobwoffenden: Removed this because this documentation site needs a refactor
# test:
# name: Test
# Commenting out because there are far too many broken links currently
# link-checker:
# name: Link Checker
# runs-on: ubuntu-latest
# permissions:
# contents: read
# steps:
# - name: Checkout
# id: checkout
# uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
# uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

# - name: Lychee
# id: lychee
# uses: lycheeverse/lychee-action@c053181aa0c3d17606addfe97a9075a32723548a # v1.9.3
# uses: lycheeverse/lychee-action@f81112d0d2814ded911bd23e3beaa9dda9093915 # v2.1.0
# with:
# args: --verbose --no-progress './**/*.md' './**/*.html' './**/*.erb' --accept 403,200,429
# fail: true
# fail: true
23 changes: 23 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
.PHONY: package preview

.DEFAULT_GOAL := preview

TECH_DOCS_GITHUB_PAGES_PUBLISHER_IMAGE ?= ghcr.io/ministryofjustice/tech-docs-github-pages-publisher
TECH_DOCS_GITHUB_PAGES_PUBLISHER_IMAGE_SHA ?= sha256:aee182dd1dd86696077ea1c3512590f17ceb9f7a47aa5b16ea4f742666911dbd # v5.0.1

package:
docker run --rm \
--name tech-docs-github-pages-publisher \
--volume $(PWD)/config:/tech-docs-github-pages-publisher/config \
--volume $(PWD)/source:/tech-docs-github-pages-publisher/source \
$(TECH_DOCS_GITHUB_PAGES_PUBLISHER_IMAGE)@$(TECH_DOCS_GITHUB_PAGES_PUBLISHER_IMAGE_SHA) \
/usr/local/bin/package

preview:
docker run -it --rm \
--name tech-docs-github-pages-publisher-preview \
--volume $(PWD)/config:/tech-docs-github-pages-publisher/config \
--volume $(PWD)/source:/tech-docs-github-pages-publisher/source \
--publish 4567:4567 \
$(TECH_DOCS_GITHUB_PAGES_PUBLISHER_IMAGE)@$(TECH_DOCS_GITHUB_PAGES_PUBLISHER_IMAGE_SHA) \
/usr/local/bin/preview
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ When contributing to the user guidance, you should make sure that your changes:
To preview the guidance locally on an MoJ Digital and Technology MacBook, you will need Docker, and then you can run:

```sh
bash scripts/local.sh
make preview
```

You can view the guidance on `http://localhost:4567` in your browser. Any content changes you make to your website will be updated in real time.
Expand Down
1 change: 0 additions & 1 deletion config/tech-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ host: https://user-guidance.analytical-platform.service.justice.gov.uk
show_govuk_logo: false
service_name: Analytical Platform User Guidance
service_link: https://user-guidance.analytical-platform.service.justice.gov.uk
phase: Alpha

# Links to show on right-hand-side of header
header_links:
Expand Down
27 changes: 0 additions & 27 deletions scripts/local.sh

This file was deleted.

0 comments on commit 4779055

Please sign in to comment.