-
Notifications
You must be signed in to change notification settings - Fork 241
ci/pr-deploy: Combine build and upload jobs #1183
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
Conversation
Both npm and node_modules cache will be generated by other PRs regardless of this job.
By doing this, we remove the need to upload the build output as a GH artifact as an intermediary step.
During development of this PR, I noticed it was not able to reuse the build cache from other PRs as I intended with #1182 . This is expected according to the docs:
In order for PRs to be able to reuse each other's cache, we need to also cache the gatsby build in the |
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.
Makes sense 👍
I did a double-take and couldn't believe the 3m36s run time 👀😀
That's a radical improvement over the previous 23m! 👏
I'm slightly concerned that the aggressive caching won't bite us in the ass in some way later (inconsistent dependencies, wrong cache shared between PRs, etc.), but I currently can't see any drawbacks to this strategy, and we can address any issues with it later.
I am too, at least a bit 😅 Dependencies should be alright because no cache will be restored if any of In any case, I purposefully left the deploy to prod job out of this caching patch series, just to be safe :) |
@roobre, thanks for improving the build process! 💯 |
As discussed in #1182 (comment), we spend around seven minutes copying a hundred-megabyte artifact across jobs. While bigger jobs are often not ideal, in this case I think it is preferable than the artifact upload/download overhead.
With a full cache hit, this brings ci/cd time to 3 minutes. This may be due to S3 being extra smart and might be larger on the first time a PR is opened though.