-
Notifications
You must be signed in to change notification settings - Fork 30
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
PR deployments #1841
PR deployments #1841
Conversation
PRbuilds results: 💚 AMP validation LightHouse Reporting --automated message |
Size Change: 0 B Total Size: 621 kB ℹ️ View Unchanged
|
Which is needed now that this workflow is being triggered by a pull request event, not a push.
Very cool! I am excited to see this, and defo you should shout about it on the Dotcom room once merged because this is a huge devEx win. I don't think there's a day goes by that I don't want this 😆 I am not going to +1 as that's not my expertise, but probably @jfsoul @shtukas @nicl could look at the script as a sense check (though not risky I don't think!) |
- name: Use Node.js 10.15.3 | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 10.15.3 |
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.
don't suppose there's any way to use the .nvmrc
file to synchronise this with the version we have there?
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.
Great point! It would be beneficial for all our actions. Unfortunately setup-node
doesn't support it, though it looks like they're actively interested in it. Alternatively we can use nvm directly thought it does seem a little hacky. I'll pop a ticket in trello to investigate
What does this change?
This adds a new action called
PR deployment
, which deploys every open PR to a public URL.It has two main components:
A main action. While this action is running, the DCR server is running and accessible
A status check. When the main action has successfully compiled and booted the node server, it announces it's ready by posting this check with the public URL.
Why?
Part of this quarter's work to improve performance. It makes it easy to use external tools like pagespeed insights, the structured data testing tool etc
Notes
This is not set to run against every branch pushed to the repository - only against PRs when they are opened or synchronized (which is what github calls it when you push to the PR's branch)
It uses an action called
workflow-run-cleanup-action
to cancel any other PR deployments on the branch. When you push to a branch it will trigger a new PR deployment, but github does not cancel the old one so they can quickly accumulate. The action works fine as a workaround, but it generates email alerts for every cancelation. Not ideal 😕 it's easy to disable github actions notifications though.The script will auto exit after 5 hours by using
timeout
. This is to preempt github canceling it after 6 and putting a big red cross next to the commit.The workflow for using this will be really based on manually re-running the main action to bring the server back online. If the feature proves useful and the manual re-run too painful, the automation route is quite possible!