Skip to content

Commit

Permalink
Merge pull request #9 from NHSDigital/dev-container-and-tasks
Browse files Browse the repository at this point in the history
added dev container, docs and tasks to repo template.
  • Loading branch information
RossBugginsNHS authored May 30, 2024
2 parents 9a0cd91 + 2414268 commit 145f731
Show file tree
Hide file tree
Showing 52 changed files with 1,192 additions and 138 deletions.
104 changes: 104 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/jekyll
{
"name": "Jekyll",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/jekyll:2-bullseye",
// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Uncomment the next line to run commands after the container is created.
"postCreateCommand": "zsh scripts/devcontainer/postcreatecommand.sh",
"postStartCommand": "zsh scripts/devcontainer/poststartcommand.sh",
"forwardPorts": [4000],
// Configure tool-specific properties.
"customizations": {
"codespaces": {
"openFiles": [
"README.md",
".github/SECURITY.md",
"docs/index.md"
]
},
"vscode": {
// Set *default* container specific settings.json values on container create.
"settings": {
"editor.formatOnSave": true,
"files.insertFinalNewline": true,
"[makefile]": {
"editor.insertSpaces": false,
"editor.detectIndentation": false
}
},
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"alefragnani.bookmarks",
"davidanson.vscode-markdownlint",
"dbaeumer.vscode-eslint",
"donjayamanne.githistory",
"eamodio.gitlens",
"editorconfig.editorconfig",
"esbenp.prettier-vscode",
"github.codespaces",
"github.github-vscode-theme",
"github.remotehub",
"github.vscode-github-actions",
"github.vscode-pull-request-github",
"hediet.vscode-drawio",
"johnpapa.vscode-peacock",
"mhutchie.git-graph",
"ms-azuretools.vscode-docker",
"ms-vscode-remote.remote-containers",
"ms-vscode-remote.remote-wsl",
"ms-vscode.hexeditor",
"ms-vscode.live-server",
"ms-vsliveshare.vsliveshare",
"redhat.vscode-xml",
"streetsidesoftware.code-spell-checker-british-english",
"tamasfe.even-better-toml",
"tomoki1207.pdf",
"vscode-icons-team.vscode-icons",
"vstirbu.vscode-mermaid-preview",
"wayou.vscode-todo-highlight",
"yzane.markdown-pdf",
"yzhang.dictionary-completion",
"yzhang.markdown-all-in-one"
]
}
},
"features": {
"ghcr.io/devcontainers/features/aws-cli:1": {
"version": "latest"
},
"ghcr.io/devcontainers/features/docker-in-docker:2": {
"moby": true,
"azureDnsAutoDetection": true,
"installDockerBuildx": true,
"installDockerComposeSwitch": true,
"version": "latest",
"dockerDashComposeVersion": "latest"
},
"ghcr.io/devcontainers/features/node:1": {
"nodeGypDependencies": true,
"version": "lts",
"nvmVersion": "latest"
},
"ghcr.io/devcontainers/features/github-cli:1": {
"installDirectlyFromGitHubRelease": true,
"version": "latest"
},
"ghcr.io/devcontainers/features/common-utils:2": {
"installZsh": true,
"configureZshAsDefaultShell": true,
"installOhMyZsh": true,
"installOhMyZshConfig": true,
"upgradePackages": true,
"username": "automatic",
"userUid": "automatic",
"userGid": "automatic"
}
}
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
71 changes: 71 additions & 0 deletions .github/workflows/jekyll-gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

# Sample workflow for building and deploying a Jekyll site to GitHub Pages
name: Deploy Jekyll site to Pages

on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
# Build job
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: docs
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Ruby
uses: ruby/setup-ruby@8575951200e472d5f2d95c625da0c7bec8217c42 # v1.161.0
with:
ruby-version: '3.1' # Not needed with a .ruby-version file
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
cache-version: 0 # Increment this number if you need to re-download cached gems
working-directory: './docs'
- name: Setup Pages
id: pages
uses: actions/configure-pages@v5
- name: Build with Jekyll
working-directory: ./docs
# Outputs to the './_site' directory by default
run: bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}"
env:
JEKYLL_ENV: production
- name: Upload artifact
# Automatically uploads an artifact from the './_site' directory by default
uses: actions/upload-pages-artifact@v3
with:
path: "docs/_site/"

# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
2 changes: 2 additions & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# This file is for you! Please, updated to the versions agreed by your team.

pre-commit 3.6.0
nodejs 18.18.2
gitleaks 8.15.3

# ==============================================================================
# The section below is reserved for Docker image versions.
Expand Down
36 changes: 0 additions & 36 deletions .vscode/extensions.json

This file was deleted.

7 changes: 0 additions & 7 deletions .vscode/settings.json

This file was deleted.

69 changes: 69 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@

{
"version": "2.0.0",
"tasks": [
{
"label": "Start Make Config",
"type": "shell",
"command": "make config",
"group": "none",
"presentation": {
"reveal": "always",
"panel": "new"
},
"runOptions": {
"runOn": "folderOpen",
}
}
],
"settings": {
"workspace-terminals.switchTerminal": "always",
"workspace-terminals.auto": "always",
"markdownlint.config": {
"MD013": false,
"MD024": { "siblings_only": true },
"MD033": false
},
"cSpell.words": [
"Codespaces",
"endfor"
]
},
"extensions": {
"recommendations": [
"alefragnani.bookmarks",
"davidanson.vscode-markdownlint",
"dbaeumer.vscode-eslint",
"donjayamanne.githistory",
"eamodio.gitlens",
"editorconfig.editorconfig",
"esbenp.prettier-vscode",
"github.codespaces",
"github.github-vscode-theme",
"github.remotehub",
"github.vscode-github-actions",
"github.vscode-pull-request-github",
"hediet.vscode-drawio",
"johnpapa.vscode-peacock",
"mhutchie.git-graph",
"ms-azuretools.vscode-docker",
"ms-vscode-remote.remote-containers",
"ms-vscode-remote.remote-wsl",
"ms-vscode.hexeditor",
"ms-vscode.live-server",
"ms-vsliveshare.vsliveshare",
"redhat.vscode-xml",
"streetsidesoftware.code-spell-checker-british-english",
"tamasfe.even-better-toml",
"tomoki1207.pdf",
"vscode-icons-team.vscode-icons",
"vstirbu.vscode-mermaid-preview",
"wayou.vscode-todo-highlight",
"yzane.markdown-pdf",
"yzhang.dictionary-completion",
"yzhang.markdown-all-in-one",
"joshx.workspace-terminals"
],
"unwantedRecommendations": []
}
}
6 changes: 6 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
_site
.sass-cache
.jekyll-cache
.jekyll-metadata
vendor
#Gemfile.lock
11 changes: 11 additions & 0 deletions docs/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "attach",
"name": "Attach",
"preLaunchTask": "jekyll"
}
]
}
13 changes: 13 additions & 0 deletions docs/.vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "jekyll",
"options": {
"cwd": "${workspaceFolder}"
},
"command": "make debug",
"type": "shell"
}
]
}
25 changes: 25 additions & 0 deletions docs/404.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
permalink: /404.html
layout: default
---

<style type="text/css" media="screen">
.container {
margin: 10px auto;
max-width: 600px;
text-align: center;
}
h1 {
margin: 30px 0;
font-size: 4em;
line-height: 1;
letter-spacing: -1px;
}
</style>

<div class="container">
<h1>404</h1>

<p><strong>Page not found :(</strong></p>
<p>The requested page could not be found.</p>
</div>
36 changes: 36 additions & 0 deletions docs/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
source "https://rubygems.org"
# Hello! This is where you manage which Jekyll version is used to run.
# When you want to use a different version, change it below, save the
# file and run `bundle install`. Run Jekyll with `bundle exec`, like so:
#
# bundle exec jekyll serve
#
# This will help ensure the proper Jekyll version is running.
# Happy Jekylling!
gem "jekyll", "~> 4.3.3"
# This is the default theme for new Jekyll sites. You may change this to anything you like.
gem "minima", "~> 2.5"
# If you want to use GitHub Pages, remove the "gem "jekyll"" above and
# uncomment the line below. To upgrade, run `bundle update github-pages`.
# gem "github-pages", group: :jekyll_plugins
# If you have any plugins, put them here!
group :jekyll_plugins do
gem "jekyll-feed", "~> 0.12"
gem "jekyll-drawio"
end

# Windows and JRuby does not include zoneinfo files, so bundle the tzinfo-data gem
# and associated library.
platforms :mingw, :x64_mingw, :mswin, :jruby do
gem "tzinfo", ">= 1", "< 3"
gem "tzinfo-data"
end

# Performance-booster for watching directories on Windows
gem "wdm", "~> 0.1.1", :platforms => [:mingw, :x64_mingw, :mswin]

# Lock `http_parser.rb` gem to `v0.6.x` on JRuby builds since newer versions of the gem
# do not have a Java counterpart.
gem "http_parser.rb", "~> 0.6.0", :platforms => [:jruby]

gem "just-the-docs"
Loading

0 comments on commit 145f731

Please sign in to comment.