1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

docuactions/cache を使って Docusaurus の build を高速化する

Last updated at Posted at 2024-12-20

はじめに

Meta社が管理する React ベースのドキュメント管理ツール Docusaurus 。
様々な機能があり簡単に導入できますが、 Build に時間がかかってしまいます。 GitHub Actions に docuactions/cache の定義を1行追加するだけで、平均 30s 程高速化できたのでその紹介です。

docuactions/cache について

docuactions/cache は .docusaurus 及び node_modules/.cache または.yarn/.cache を cache し build を高速化してくれます。

docuactions/cache を導入する

README.md に記載されている通り、 npm ci, npm install 後に docuactions/cache@v1 を追記してください。

name: Test

on:
  push:

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
      - run: npm ci
      - uses: docuactions/cache@v1
      - run: npm run docusaurus build

上記設定を追加することで 私の環境下だと 平均 30s (早いときだと1 min) の改善が見られました。

最後に

今回は docuactions/cache を紹介しましたが Organization docuactions には cache 以外の便利な action が定義されています。

気になる方は見てみてもよいでしょう。

Ref

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?