Skip to content
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

Fix gh-pages deployment workflow #36

Closed
vivalareda opened this issue Nov 25, 2023 · 6 comments
Closed

Fix gh-pages deployment workflow #36

vivalareda opened this issue Nov 25, 2023 · 6 comments

Comments

@vivalareda
Copy link
Contributor

The workflow currently requires a cach dependancy which is useless because most of the time it's just the root and it can just default back to that if it's not provided like it is currently doing for some of the other inputs

@rngadam
Copy link
Contributor

rngadam commented Nov 27, 2023

I'm unsure why you're fixing it by disabling this instead of creating a package-lock.json so that caching can work properly?

https://github.com/actions/setup-node

   # Used to specify the path to a dependency file: package-lock.json, yarn.lock, etc. 
    # It will generate hash from the target file for primary key. It works only If cache is specified.  
    # Supports wildcards or a list of file names for caching multiple dependencies.
    # Default: ''
    cache-dependency-path: ''

Caching is to speed up the build process. Have you compared the build time before and after caching is enabled? and before and after cache-dependency-path is properly specified?

@vivalareda
Copy link
Contributor Author

I'm not sure I understand the question or if you misunderstood my description, I am not disabling anything, all I am doing is assigning a default value to the variable

@rngadam
Copy link
Contributor

rngadam commented Dec 5, 2023

I'm saying that we may want to look into whether this caching work. Caching should be based on the packages definition, most likely a file such as package-lock.json.

why caching?

looking up and installing dependencies is an expensive network/disk operation. by caching dependencies, we accelerate build time. after the first caching step, subsequent calls should be faster.

what should be the value of cache-dependency-path?

looking at the source for setup-node, we have this:

https://github.com/actions/setup-node/blob/5ef044f9d09786428e6e895be6be17937becee3a/src/cache-restore.ts#L25

  const cachePaths = await getCacheDirectories(

which is implemented here:it

https://github.com/actions/setup-node/blob/5ef044f9d09786428e6e895be6be17937becee3a/src/cache-utils.ts#L211

and only uses cacheDependencyPath if the package manager is yarn, which we don't use (we decided on npm)

this means that cacheDependencyPath = ''

and default should not be '.' but ''; probably leftover from when we switched from yarn

what does caching neeed?

it needs a lock file for the dependencies:

https://github.com/actions/setup-node/blob/5ef044f9d09786428e6e895be6be17937becee3a/src/cache-utils.ts#L23

lockFilePatterns: ['package-lock.json', 'npm-shrinkwrap.json', 'yarn.lock'],

what is package-lock.json and how do we use it?

do we have package-lock.json in our projects?

@vivalareda
Copy link
Contributor Author

I'm saying that we may want to look into whether this caching work. Caching should be based on the packages definition, most likely a file such as package-lock.json.

why caching?

looking up and installing dependencies is an expensive network/disk operation. by caching dependencies, we accelerate build time. after the first caching step, subsequent calls should be faster.

what should be the value of cache-dependency-path?

looking at the source for setup-node, we have this:

https://github.com/actions/setup-node/blob/5ef044f9d09786428e6e895be6be17937becee3a/src/cache-restore.ts#L25

  const cachePaths = await getCacheDirectories(

which is implemented here:it

https://github.com/actions/setup-node/blob/5ef044f9d09786428e6e895be6be17937becee3a/src/cache-utils.ts#L211

and only uses cacheDependencyPath if the package manager is yarn, which we don't use (we decided on npm)

this means that cacheDependencyPath = ''

and default should not be '.' but ''; probably leftover from when we switched from yarn

what does caching neeed?

it needs a lock file for the dependencies:

https://github.com/actions/setup-node/blob/5ef044f9d09786428e6e895be6be17937becee3a/src/cache-utils.ts#L23

lockFilePatterns: ['package-lock.json', 'npm-shrinkwrap.json', 'yarn.lock'],

what is package-lock.json and how do we use it?

do we have package-lock.json in our projects?

well I added it because of docusaurus when I deployed it I was getting issues because the package wasn't at the root of the project at the time

@ThomasCardin
Copy link
Member

Won't do. We are now using kubernetes to deploy our solution

@github-project-automation github-project-automation bot moved this from Todo to Done in DevSecOps Jan 23, 2024
@rngadam
Copy link
Contributor

rngadam commented Jan 23, 2024

@ThomasCardin ok to close this, but there's also a discussion about caching during in #36 (comment) that I would like to have followed up as we want to accelerate build time of our dockers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants