Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
}
},
"forwardPorts": [4000],
"image": "ghcr.io/nhsdigital/nhs-notify-template-repository:latest",
"image": "ghcr.io/nhsdigital/nhs-notify-web-cms-jekyll-devcontainer:latest",
"name": "Jekyll",
"runArgs": ["--platform=linux/amd64"]
}
39 changes: 39 additions & 0 deletions .github/workflows/devcontainer-build-publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: "Build and publish devcontainer"

on:
push:
branches:
- main
paths:
- gem.lock
- docs/Gemfile.lock
- src/jekyll-devcontainer/**
workflow_dispatch:

permissions:
contents: read
packages: write

jobs:
build-and-publish:
name: "Build and publish Jekyll devcontainer"
runs-on: ubuntu-latest
timeout-minutes: 30
env:
BUILD_TARGET: devcontainer
DEVCONTAINER_IMAGE: ghcr.io/nhsdigital/nhs-notify-web-cms-jekyll-devcontainer
steps:
- name: "Checkout code"
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6

- name: "Log in to GitHub Container Registry"
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u "${{ github.actor }}" --password-stdin

- name: "Build devcontainer image"
run: |
make build

- name: "Publish devcontainer image"
run: |
make publish
32 changes: 30 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,39 @@ include scripts/init.mk

# Example CI/CD targets are: dependencies, build, publish, deploy, clean, etc.

DEVCONTAINER_DIR ?= src/jekyll-devcontainer
DEVCONTAINER_IMAGE ?= ghcr.io/nhsdigital/nhs-notify-web-cms-jekyll-devcontainer
DEVCONTAINER_TITLE ?= NHS Notify Web CMS Jekyll devcontainer

dependencies: # Install dependencies needed to build and test the project @Pipeline
# TODO: Implement installation of your project dependencies

build: # Build the project artefact @Pipeline
(cd docs && make build)
if [[ "$${BUILD_TARGET:-all}" == "devcontainer" ]]; then
make build-devcontainer
else
(cd docs && make build)
make build-devcontainer
fi

publish: # Publish the project artefact @Pipeline
# TODO: Implement the artefact publishing step
if [[ "$${BUILD_TARGET:-all}" == "devcontainer" ]]; then
make publish-devcontainer
Comment thread
aidenvaines-cgi marked this conversation as resolved.
Outdated
else
make publish-devcontainer
fi

build-devcontainer: # Build the devcontainer image @Pipeline
make docker-build \
dir=${DEVCONTAINER_DIR} \
DOCKER_IMAGE=${DEVCONTAINER_IMAGE} \
DOCKER_TITLE="${DEVCONTAINER_TITLE}"

publish-devcontainer: # Publish the devcontainer image @Pipeline
make docker-push \
dir=${DEVCONTAINER_DIR} \
DOCKER_IMAGE=${DEVCONTAINER_IMAGE} \
DOCKER_TITLE="${DEVCONTAINER_TITLE}"

deploy: # Deploy the project artefact to the target environment @Pipeline
# TODO: Implement the artefact deployment step
Expand All @@ -34,7 +59,10 @@ version:

${VERBOSE}.SILENT: \
build \
build-devcontainer \
clean \
config \
dependencies \
deploy \
publish \
publish-devcontainer \
7 changes: 7 additions & 0 deletions src/jekyll-devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM --platform=linux/amd64 mcr.microsoft.com/devcontainers/jekyll:2-bullseye

LABEL org.opencontainers.image.source=https://github.com/NHSDigital/nhs-notify-web-cms

COPY packages.txt packages.txt

RUN apt-get update && xargs apt-get -y install < packages.txt
1 change: 1 addition & 0 deletions src/jekyll-devcontainer/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.0.${yyyy}${mm}${dd}.${HH}${MM}${SS}-${hash}
39 changes: 39 additions & 0 deletions src/jekyll-devcontainer/packages.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
ca-certificates
fonts-liberation
libasound2
libatk-adaptor
libatk-bridge2.0-0
libatk1.0-0
libc6
libcairo2
libcups2
libdbus-1-3
libexpat1
libfontconfig1
libgbm1
libgcc1
libglib2.0-0
libgtk-3-0
libnspr4
libnss3
libpango-1.0-0
libpangocairo-1.0-0
libstdc++6
libx11-6
libx11-xcb1
libxcb1
libxcomposite1
libxcursor1
libxdamage1
libxext6
libxfixes3
libxi6
libxrandr2
libxrender1
libxss1
libxtst6
lsb-release
openbox
wget
xdg-utils
xorg
Loading