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

docs: add bun usage example to 04-ci-build-caching.mdx #60343

Closed
wants to merge 1 commit into from

Conversation

JCharante
Copy link
Contributor

fixes #57079

This adds how to use github actions/cache@v3 with bun by hashing bun's lockfile instead of package-lock.json or yarn.lock.

This does add a whole new paragraph of text, so it might be necessary or preferable to instead change the first example instead. I just thought it'd get messy to keep adding comments to the original code block.

I have a proof of concept for using this build step here https://github.com/JCharante/nextjs-github-actions-bun

and it can be seen in the latest build that the error message No build cache found. does not occur because Next.js is using the cache.

@JCharante JCharante requested review from a team as code owners January 7, 2024 00:40
@JCharante JCharante requested review from timeyoutakeit and lydiahallie and removed request for a team January 7, 2024 00:40
@ijjk
Copy link
Member

ijjk commented Jan 7, 2024

Allow CI Workflow Run

  • approve CI run for commit: 6f43667

Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer

2 similar comments
@ijjk
Copy link
Member

ijjk commented Jan 7, 2024

Allow CI Workflow Run

  • approve CI run for commit: 6f43667

Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer

@ijjk
Copy link
Member

ijjk commented Jan 7, 2024

Allow CI Workflow Run

  • approve CI run for commit: 6f43667

Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer

@samcx
Copy link
Member

samcx commented Jan 8, 2024

@JCharante Thank you for submitting a :pr:!

I do think it will be better to add your :bun: example here instead → https://github.com/actions/cache/blob/main/examples.md since we already have a link to more examples there. That way, we are not introducing any sort of package manager favoritism in our :docs:.

@JCharante
Copy link
Contributor Author

Sure @samcx that makes sense. Would it be fair to update the comment in the next.js docs to say that examples for other package managers are available on that page instead of specifying yarn?

@samcx
Copy link
Member

samcx commented Jan 8, 2024

@JCharante That sounds fair to me!

path: |
${{ github.workspace }}/.next/cache
# Generate a new cache whenever packages or source files change.
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/bun.lockb.json') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }}

Choose a reason for hiding this comment

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

question: does bun generates *.lockb.json ? AFAIK as I see bun only generates bun.lockb

Copy link

Choose a reason for hiding this comment

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

@samcx
Copy link
Member

samcx commented Mar 26, 2024

Closing this as per this comment → #60343 (comment).

@samcx samcx closed this Mar 26, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Docs: Caching in GitHub Actions with Bun
5 participants