-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add guide for using GitHub Codespaces #152
Open
paulmsmith
wants to merge
24
commits into
main
Choose a base branch
from
issue/70
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 17 commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
4788d10
adds devcontainer.json file configuring github codespaces to run the …
paulmsmith e1a5bb0
adds link to new documentation page for codespaces
paulmsmith c5d845b
improved content for using the kit without installation
paulmsmith 7694838
update var name to make new sense
paulmsmith ecbd2ad
updates guidance for codespaces
paulmsmith f2f07e7
fix typo on title
paulmsmith 1aae5e2
remove unused images
paulmsmith 8f0157a
tweaks of pages
vickytnz f7896fe
fix typo
paulmsmith 48062d4
Make capitalisation tweak just to test Codespaces
sarawilcox ab22cee
content tweaks to codespaces guide
anandamaryon1 2473379
add content about forking the repo
anandamaryon1 4cdd8d1
Merge branch 'main' into issue/70
frankieroberto dfe0410
Remove index suffix
frankieroberto 6c96cd8
Minor tweak to link text
frankieroberto 89e47bb
Remove commented out header
frankieroberto 2d2a320
Don't recommend forking for now
frankieroberto ee53a18
Remove forking button location image
frankieroberto 17d4474
Remove fork button screenshot
frankieroberto b529b94
Remove devcontainer
frankieroberto b4644df
Update create-a-codespace.html
vickytnz e88bb96
coespaces guide content tweaks
anandamaryon1 5e6a25d
Merge branch 'main' into issue/70
frankieroberto b3131c3
Update guide to reference new template repository
frankieroberto File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
{ | ||
"name": "NHS Prototype Kit", | ||
"image": "mcr.microsoft.com/devcontainers/universal:2", | ||
// codespaces seems to have an issue using port 2000 so setting to 2001 for the NHS Prototype Kit | ||
"runArgs": ["--env", "PORT=2001"], | ||
"portsAttributes": { | ||
"3001": { | ||
"label": "Running prototype", | ||
// -------------------------------- | ||
// onAutoForward possible options | ||
// -------------------------------- | ||
// you can change the value to one of the following possible options: | ||
// 'notify' (shows a prompt), | ||
// 'silent' (does nothing) | ||
// 'openBrowser' (opens the prototype URL in a browser window/tab) | ||
// 'openPrview' (opens the codespaces preview window to present the running prototype to the user) | ||
"onAutoForward": "openPreview" | ||
} | ||
}, | ||
// forward the port for the browersync process | ||
"forwardPorts": [3001], | ||
"otherPortsAttributes": { "onAutoForward": "ignore" }, | ||
// when created - sets the git merge statergy to rebase to hopefully make easier time of merging | ||
"onCreateCommand": "git config --global pull.rebase true", | ||
// after creation - installs the node packages | ||
"postCreateCommand": "npm install", | ||
// A command to run each time a tool has successfully attached to the container | ||
"postAttachCommand": { | ||
"server": "npm run watch" | ||
}, | ||
// codespace customisations | ||
"customizations": { | ||
// Configure properties specific to VS Code web-basde IDE used within codespaces. | ||
"vscode": { | ||
// editor settings | ||
"settings": { | ||
// uncomment the following lines to hide files not needed to update content | ||
// "files.exclude": { | ||
// "{docs,lib,linters,middleware,node_modules,public,tests,NHS111.Shared.Frontend}/": true, | ||
// "*{CHANGELOG,CONTRIBUTING}.md": true, | ||
// "app/{data,assets}/": true, | ||
// "app/*.js": true, | ||
// "*.{js,yml,json}": true, | ||
// ".*": true, | ||
// "LICENSE": true | ||
// }, | ||
// make emmet work within nunjucks | ||
"emmet.includeLanguages": { | ||
"njk": "html", | ||
"nunjucks": "html", | ||
"erb": "html", | ||
"jinja": "html", | ||
"jinja-html": "html", | ||
"markdown": "html" | ||
}, | ||
"html.suggest.html5": true | ||
}, | ||
// bundle the following editor extensions | ||
"extensions": [ | ||
// nunjuck syntax highlighting | ||
"douglaszaltron.nunjucks-vscode-extensionpack" | ||
] | ||
} | ||
} | ||
} |
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{% set installEnvironment = "Codespaces" %} | ||
{% set steps_total = "2" %} | ||
|
||
{% extends 'layout.html' %} | ||
|
||
{% block beforeContent %} | ||
{{ breadcrumb({ | ||
items: [ | ||
{ | ||
href: "/", | ||
text: "Home" | ||
}, | ||
{ | ||
href: "/install/", | ||
text: "Get started" | ||
} | ||
], | ||
href: "/install/codespaces/", | ||
text: "Install and use the kit with your web browser" | ||
}) }} | ||
{% endblock %} | ||
|
||
{% block content %} | ||
<div class="nhsuk-grid-row"> | ||
<div class="nhsuk-grid-column-two-thirds"> | ||
|
||
<h1> | ||
<span class="nhsuk-caption-l">Step | ||
{{ current_step }} | ||
of | ||
{{ steps_total }}{{[":", installEnvironment ] | join(" ") if installEnvironment }}</span> | ||
{% block stepHeader %}{% endblock %} | ||
</h1> | ||
|
||
{% block page_content %}{% endblock %} | ||
|
||
{% block pagination %}{% endblock %} | ||
|
||
</div> | ||
</div> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
{% set installEnvironment = "Codespaces" %} | ||
{% set current_step = '1' %} | ||
|
||
{% block pageTitle %} | ||
Create a codespace - NHS prototype kit | ||
{% endblock %} | ||
|
||
{% extends 'install/codespace.html' %} | ||
|
||
{% block beforeContent %} | ||
{{ breadcrumb({ | ||
items: [ | ||
{ | ||
href: "/", | ||
text: "Home" | ||
}, | ||
{ | ||
href: "/install/codespaces/", | ||
text: "Install the kit in your web browser" | ||
} | ||
] | ||
}) }} | ||
{% endblock %} | ||
|
||
{% block stepHeader %} | ||
Create a Codespace | ||
{% endblock %} | ||
|
||
{% block page_content %} | ||
|
||
<p class="nhsuk-lede-text">To use the kit within a Codespace you will first need to create one.</p> | ||
|
||
<h2>1. Go to the prototype repository</h2> | ||
|
||
<p>Go to the GitHub repository for the prototype you wish to use. For this guide we will be starting a new prototype, using the | ||
<a href="https://github.com/nhsuk/nhsuk-prototype-kit">NHS prototype kit repository</a>. | ||
</p> | ||
|
||
<p>If you using an existing prototype, go to step 2.</p> | ||
|
||
<p>If you are starting a new prototype, follow the [get started guide](/install) to set up a new prototype and then publish it to GitHub.</p> | ||
|
||
<p><img class="app-img-guide nhsuk-u-margin-bottom-0" alt="Location of the fork button on the repository page" src="/images/codespaces/fork-button.png"></p> | ||
frankieroberto marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
<p>Ask your development team or technical leadership where you should store your prototype and how to get access.</p> | ||
|
||
<h2>2. Create a new Codespace</h2> | ||
|
||
<p>On every Github repository page is a 'Code' button which is used to get a copy of or to use the code held within the git repository.</p> | ||
|
||
<p>Locate the button, click it, a dialogue box will open, at the top of the dialogue click the 'Codespaces' tab.</p> | ||
<p>Next click on the 'Create codespace on main' button. Which will open your new codespace in a new browser tab or window.</p> | ||
|
||
<p><img class="app-img-guide nhsuk-u-margin-bottom-0" alt="Screenshot of the location of create a codespace on main button" src="/images/codespaces/create-a-codespace.png"></p> | ||
<p>The 'Create codespace on main' button will either be shown as a large button or a small plus symbol after the label 'your workspaces in the cloud'.</p> | ||
|
||
<h2>3. Wait for the Codespace setup to finish</h2> | ||
|
||
<p>The Codespace will open in a new tab (or window) and begin the setup process.</p> | ||
|
||
<p>You will see an interface building with a progress message showing that the space (known as a 'container') is being created or rebuilt.</p> | ||
|
||
<p>This can take between 30 seconds and 5 minutes.</p> | ||
|
||
<h2>4. Check that it has worked</h2> | ||
|
||
<p>Once the Codespace has been created, you will then see the 'terminal' tab with commands being exectuted to start the prototype kit.</p> | ||
<p>When the prototype has started it will open a preview window displaying the homepage of the prototype.</p> | ||
|
||
|
||
<p><img class="app-img-guide nhsuk-u-margin-bottom-0" alt="Screenshot of the running codespace" src="/images/codespaces/running-codespace.png"></p> | ||
|
||
<p>You now have a copy of the NHS prototype kit installed and running within a new GitHub Codespace.</p> | ||
|
||
<p>This means you can create and edit prototypes entirely in your browser.</p> | ||
|
||
{% endblock %} | ||
|
||
{% block pagination %} | ||
{{ pagination({ | ||
"previousUrl": "/install/codespaces/index", | ||
"previousPage": "Get started", | ||
"nextUrl": "/install/codespaces/working-with-codespaces", | ||
"nextPage": "Step 2: Working with Codespaces" | ||
}) }} | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
{% extends 'layout.html' %} | ||
|
||
{% block pageTitle %} | ||
Install and use the kit with your web browser - NHS prototype kit | ||
{% endblock %} | ||
|
||
{% block beforeContent %} | ||
{{ breadcrumb({ | ||
items: [ | ||
{ | ||
href: "/", | ||
text: "Home" | ||
}, | ||
{ | ||
href: "/install/", | ||
text: "Get started" | ||
} | ||
] | ||
}) }} | ||
{% endblock %} | ||
|
||
{% block content %} | ||
<div class="nhsuk-grid-row"> | ||
<div class="nhsuk-grid-column-two-thirds"> | ||
|
||
<h1 class="nhsuk-heading-xl">Install and use the kit with your web browser</h1> | ||
|
||
<p class="nhsuk-body-l">If you cannot install the kit on your computer (for example, beause you are not allowed to install Node.js) you can use an online service to edit and run code using your web browser.</p> | ||
|
||
<p>Services that you can use include:<p> | ||
|
||
<ul> | ||
<li> | ||
<a href="https://github.com/features/codespaces">GitHub Codespaces</a> – free for around 60 hours per month | ||
</li> | ||
<li> | ||
<a href="https://www.gitpod.io/">Gitpod</a> – free for around 50 hours per month | ||
</li> | ||
</ul> | ||
|
||
<p>For this guide we are using GitHub Codespaces.</p> | ||
|
||
<h2 class="nhsuk-heading-l">Before you begin</h2> | ||
|
||
<p>You do not need any technical knowledge to use this guide.</p> | ||
|
||
<p>You will need a | ||
<a href="https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out">GitHub account</a>. | ||
</p> | ||
|
||
<p>We will show you how to:</p> | ||
<ul class="nhsuk-list nhsuk-list--bullet"> | ||
<li>set up the Codespace | ||
</li> | ||
<li>work with the Codespace</li> | ||
</ul> | ||
<p> | ||
Installation usually takes up to 5 minutes. | ||
</p> | ||
|
||
{{ actionLink({ text: "Start guide for using the kit in a web browser", href: "/install/codespaces/create-a-codespace", classes: "nhsuk-u-margin-top-x nhsuk-heading-l" }) }} | ||
|
||
</div> | ||
</div> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
{% set installEnvironment = "Codespaces" %} | ||
{% set current_step = 2 %} | ||
|
||
{% block pageTitle %} | ||
Editing the kit with Codespaces - NHS prototype kit | ||
{% endblock %} | ||
|
||
{% extends 'install/codespace.html' %} | ||
|
||
{% block beforeContent %} | ||
{{ breadcrumb({ | ||
items: [ | ||
{ | ||
href: "/", | ||
text: "Home" | ||
}, | ||
{ | ||
href: "/install/codespaces/", | ||
text: "Install the kit in your web browser" | ||
} | ||
] | ||
}) }} | ||
{% endblock %} | ||
|
||
{% block stepHeader %} | ||
Editing the kit with Codespaces | ||
{% endblock %} | ||
|
||
{% block page_content %} | ||
|
||
<p class="nhsuk-lede-text">If you are using the browser to edit the kit, you need to manage changes in Codespaces.</p> | ||
|
||
<h2>Save changes</h2> | ||
|
||
<p>Any changes you make are not shared with anybody else until you commit them to Git and push them to the repository.</p> | ||
|
||
<p>You can use the Codespace code editor and user interface to manage changes with GitHub. You can use the | ||
<a href="https://docs.github.com/en/codespaces/getting-started/quickstart">quickstart guide for working with Codespaces</a> | ||
</p> | ||
|
||
<h2>Manage prototypes</h2> | ||
|
||
<p>When a Codespace is deleted, you will lose any uncommitted and unpushed changes.</p> | ||
<p>GitHub Codespaces are automatically deleted after they have been stopped and have remained inactive for a defined number of days, by default this is 30 days.</p> | ||
|
||
|
||
|
||
<h2>Publish prototypes online</h2> | ||
|
||
<p>Codespaces are temporary and do not usually have passwords. Do not use them to <a href='/how-tos/publish-your-prototype-online'>publish your prototypes online</a>.</p> | ||
|
||
<h2>Get going</h2> | ||
|
||
<p> | ||
<a href="/how-tos/build-basic-prototype/index">Build a basic prototype</a> | ||
or | ||
<a href="/how-tos/index">view other guides</a>.</p> | ||
|
||
{% endblock %} | ||
|
||
{% block pagination %} | ||
{{ pagination({ | ||
"previousUrl": "/install/codespaces/create-a-codespace", | ||
"previousPage": "Step 1: Create a Codespace" | ||
}) }} | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don’t think we need to include this file as this would just enable you to run the documentation website in Codespaces, rather than the kit itself, which is over here: https://github.com/nhsuk/nhsuk-prototype-kit/
But it might be useful to include anyway to allow us to try it out for making changes to the website?