Skip to content
This repository has been archived by the owner on Sep 1, 2021. It is now read-only.

Add PR deployment action #684

Merged
merged 14 commits into from
Sep 14, 2020
Merged

Add PR deployment action #684

merged 14 commits into from
Sep 14, 2020

Conversation

jacobwinch
Copy link
Contributor

@jacobwinch jacobwinch commented Sep 7, 2020

Why are you doing this?

This PR provides an easy mechanism for deploying a branch to a public URL. In the short-term this can be used for manually testing changes (either your own, or someone else's, as part of the code review process). Longer term, exposing a public URL for every PR allows us to easily run additional tasks/checks (e.g. taking screenshots, running performance tests etc.).

Thanks to @jorgeazevedo who did all of the hard work on this with Dotcom (see guardian/dotcom-rendering#1841) - I've borrowed liberally from his work here!

Whilst under development, this check won't (automatically) run against every PR - see How will it work? section for more details.

Changes

  • Add new GitHub workflow
  • Modify config fetching code to avoid call to SSM if running in the GH Actions environment

How will it work?

Adding the PR Deployment label starts the new workflow*:

image

Once the workflow has started the application, another status check will appear. This provides a link to the running environment:

image

The check will only run if the PR Deployment label is added to a PR. Adding any other label will produce a 'skipped' check:

image

*Note that this workflow will keep running (and retain the yellow 'pending' dot) until the timeout is reached. Developers do not need to wait for this check to 'finish' before merging.

@jacobwinch jacobwinch added the Do not merge ⚠️ Request is not ready for releasing label Sep 7, 2020
@jacobwinch jacobwinch removed the Do not merge ⚠️ Request is not ready for releasing label Sep 11, 2020
@jacobwinch jacobwinch changed the title Test: do not review Add PR deployment action Sep 11, 2020
@jacobwinch jacobwinch added enhancement New feature or request PR Deployment and removed enhancement New feature or request labels Sep 11, 2020
@jacobwinch jacobwinch marked this pull request as ready for review September 11, 2020 08:20
Copy link
Contributor

@webb04 webb04 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great!

Is this time the creation time rather than the expiry? "This PR is now live until Fri 08:57. Click details to access it ->"

Or is it open for 12 hours?

@jacobwinch
Copy link
Contributor Author

jacobwinch commented Sep 11, 2020

Is this time the creation time rather than the expiry? "This PR is now live until Fri 08:57. Click details to access it ->"

Good catch @webb04 - we're adding an hour to the current time (date -d "+1 hour" "+%a %H:%M"), but the timezone on the GitHub Containers is UTC (which is 1 hour behind BST), so we were logging the current time! This should fix it: 3d74761

image

@JamieB-gu
Copy link
Contributor

FYI @alexduf

@jacobwinch jacobwinch merged commit 15dd0c8 into master Sep 14, 2020
@jacobwinch jacobwinch deleted the jw-test-gh-action branch September 14, 2020 10:25
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants