Skip to content
This repository has been archived by the owner on Jan 13, 2024. It is now read-only.

feat: Docker optimizations to improve run time #286

Closed
wants to merge 1 commit into from

Conversation

iamludal
Copy link
Contributor

@iamludal iamludal commented Aug 11, 2023

Following #285

This PR improves run time by making the following Docker optimizations:

  • Use public Docker image from ghcr instead of building it at every run
  • Leverage @vercel/ncc and multi-stage build to reduce the final image size (from 240MB to 180MB, see below)
$ docker images
REPOSITORY                    TAG           IMAGE ID       CREATED          SIZE
action-node-multi             latest        902e7b743d17   3 minutes ago    180MB
action-node                   latest        6cd06307972c   3 minutes ago    240MB

Migrating to a node engine instead of Docker seems more difficult. To be able to install a npm package, users should add an extra step actions/setup-node before using the action, which is not convenient. Another way to install a npm package is to use the npm programmatic API, but it has been removed since version 8.0.0, so I don't think it's a great idea.

Anyway, performance improvements are not as significant as using a node engine. But with these changes, the Docker image does not contain the entirenode_modules folder and the image is not built at each run.

Results

Before:
image

After:
image

@aslafy-z
Copy link
Owner

Thank you for the contribution. Are you sure about the order of the screenshots? Looks like actions are longer to execute in average from your numbers.
I will do some more testing in the coming days to ensure we're not breaking anything, I'll get back to you ASAP.

@iamludal
Copy link
Contributor Author

You're right, I messed up with the order of the screenshots, thanks. 😄
I have changed the order.

@aslafy-z
Copy link
Owner

Thank you for your time, however, I decided to archive this repository. Please see https://github.com/aslafy-z/conventional-pr-title-action#important-notice-this-repository-has-been-archived.

@aslafy-z aslafy-z closed this Jan 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants