Skip to content

Commit 18c9236

Browse files
authored
Merge pull request #292 from mziyut/create-pull-request/patch-pull-articles
Pull articles
2 parents 16a0299 + cb45619 commit 18c9236

File tree

2 files changed

+62
-3
lines changed

2 files changed

+62
-3
lines changed

qiita/public/17846af0fcb3b1d660eb.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ tags:
44
- TypeScript
55
- Remix
66
- Supabase
7-
private: true
8-
updated_at: '2024-12-06T00:39:20+09:00'
7+
private: false
8+
updated_at: '2024-12-15T07:03:37+09:00'
99
id: 17846af0fcb3b1d660eb
10-
organization_url_name: null
10+
organization_url_name: foundingbase
1111
slide: false
1212
ignorePublish: false
1313
---
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
---
2+
title: ' docuactions/cache を使って Docusaurus の build を高速化する'
3+
tags:
4+
- GitHub
5+
- Docusaurus
6+
- GitHubActions
7+
private: true
8+
updated_at: '2024-12-15T00:38:53+09:00'
9+
id: d61317865d0fe5c42085
10+
organization_url_name: null
11+
slide: false
12+
ignorePublish: false
13+
---
14+
15+
## はじめに
16+
17+
Meta社が管理する React ベースのドキュメント管理ツール Docusaurus 。
18+
様々な機能があり簡単に導入できますが、 Build に時間がかかってしまいます。 GitHub Actions に ` docuactions/cache` の定義を1行追加するだけで、平均 30s 程高速化できたのでその紹介です。
19+
20+
## docuactions/cache について
21+
22+
docuactions/cache は `.docusaurus` 及び `node_modules/.cache` または`.yarn/.cache` を cache し build を高速化してくれます。
23+
24+
### docuactions/cache を導入する
25+
26+
README.md に記載されている通り、 `npm ci`, `npm install` 後に `docuactions/cache@v1` を追記してください。
27+
28+
```yml
29+
name: Test
30+
31+
on:
32+
push:
33+
34+
jobs:
35+
build:
36+
runs-on: ubuntu-latest
37+
steps:
38+
- uses: actions/checkout@v4
39+
- uses: actions/setup-node@v4
40+
- run: npm ci
41+
- uses: docuactions/cache@v1
42+
- run: npm run docusaurus build
43+
```
44+
45+
上記設定を追加することで 私の環境下だと 平均 30s (早いときだと1 min) の改善が見られました。
46+
47+
## 最後に
48+
49+
今回は docuactions/cache を紹介しましたが Organization docuactions には cache 以外の便利な action が定義されています。
50+
51+
https://github.com/docuactions
52+
53+
気になる方は見てみてもよいでしょう。
54+
55+
## Ref
56+
57+
https://github.com/docuactions/cache
58+
59+
https://github.com/docuactions

0 commit comments

Comments
 (0)