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

Add examples of twoslash types caching for vitepress with actions/cache #840

Open
kravetsone opened this issue Nov 20, 2024 · 5 comments
Open

Comments

@kravetsone
Copy link

kravetsone commented Nov 20, 2024

It would be good if we will have example of it with easy copy-pasting

Bun install cache example:

- uses: actions/cache@v4
        with:
          path: ~/.bun/install/cache
          key: ${{ runner.os }}-${{ matrix.bun }}-bun-${{ hashFiles('**/bun.lockb') }}
          restore-keys: |
            ${{ runner.os }}-${{ matrix.bun }}-bun

What we should add to key hash of lockfile and documentation sources?

- uses: actions/cache@v4
              with:
                  path: ./docs/.vitepress/cache/twoslash
                  key: ${{ runner.os }}-twoslash-${{ hashFiles('**/bun.lockb') }}-${{ hashFiles('docs/**') }}
                  restore-keys: |
                      ${{ runner.os }}-twoslash

Related VitePress issue - vuejs/vitepress#4372

kravetsone added a commit to gramiojs/documentation that referenced this issue Nov 20, 2024
@antfu
Copy link
Member

antfu commented Nov 20, 2024

I wonder if we should cache the entire .vitepress/cache? Maybe it should be in VitePress' docs as well?

@kravetsone
Copy link
Author

I wonder if we should cache the entire .vitepress/cache? Maybe it should be in VitePress' docs as well?

Oh seems interesting... And how u answering so fast... u really great maintainer

@kravetsone
Copy link
Author

https://vitepress.dev/guide/deploy#github-pages

Looks like they dont cache .vitepress/cache directory in examples with github actions

maybe i should open it in vitepress repo

But if it will be added to vitepress repo it would be great to add important/warning to help developer)

@antfu
Copy link
Member

antfu commented Nov 20, 2024

Yes, I am happy to include it here as well. I am just more curious if there are any unwanted side-effects of caching .vitepress/cache. Which would also affects if we should put .vitepress/cache or .vitepress/cache/twoslash in our docs.

@kravetsone
Copy link
Author

I open it in VitePress repo too - vuejs/vitepress#4372

Thanks for the fast answer!

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

No branches or pull requests

2 participants