From 0a3a450922e19f9a626eaaff294407aae98cb3f6 Mon Sep 17 00:00:00 2001 From: jongwooo Date: Thu, 24 Nov 2022 20:17:04 +0900 Subject: [PATCH] ci: Use gatsby-cache action to cache gatsby build outputs Signed-off-by: jongwooo --- .github/workflows/firebase-deployment.yml | 12 ++---------- .github/workflows/generate-preview.yml | 4 ++++ .github/workflows/github-pages.yml | 12 ++---------- .github/workflows/pull-request.yml | 12 ++---------- .github/workflows/sync-api.yml | 12 ++---------- 5 files changed, 12 insertions(+), 40 deletions(-) diff --git a/.github/workflows/firebase-deployment.yml b/.github/workflows/firebase-deployment.yml index 4e0eacd4ed..23ad077aef 100644 --- a/.github/workflows/firebase-deployment.yml +++ b/.github/workflows/firebase-deployment.yml @@ -26,17 +26,9 @@ jobs: - name: Install NPM packages run: npm ci - - name: Gatsby Cache Folder - uses: actions/cache@v3 + - uses: jongwooo/gatsby-cache@v1.1.0 with: - key: cache-folder-ubuntu-latest - path: .cache - - - name: Gatsby Public Folder - uses: actions/cache@v3 - with: - key: public-folder-ubuntu-latest - path: public + key: firebase-deployment-gatsby-ubuntu-latest - name: Build Gatsby run: npm run build-ci diff --git a/.github/workflows/generate-preview.yml b/.github/workflows/generate-preview.yml index f7362a0b18..afb03731be 100644 --- a/.github/workflows/generate-preview.yml +++ b/.github/workflows/generate-preview.yml @@ -51,6 +51,10 @@ jobs: - name: Install NPM packages run: npm ci + - uses: jongwooo/gatsby-cache@v1.1.0 + with: + key: generate-preview-gatsby-ubuntu-latest + - name: Build Gatsby run: npm run build-ci env: diff --git a/.github/workflows/github-pages.yml b/.github/workflows/github-pages.yml index fe189e1e51..5a12b98023 100644 --- a/.github/workflows/github-pages.yml +++ b/.github/workflows/github-pages.yml @@ -30,17 +30,9 @@ jobs: - name: Install NPM packages run: npm ci - - name: Gatsby Cache Folder - uses: actions/cache@v3 + - uses: jongwooo/gatsby-cache@v1.1.0 with: - key: cache-folder-ubuntu-latest - path: .cache - - - name: Gatsby Public Folder - uses: actions/cache@v3 - with: - key: public-folder-ubuntu-latest - path: public + key: github-pages-gatsby-ubuntu-latest - name: Build Gatsby run: npm run build-ci diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 664fcf97db..0d07769302 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -58,17 +58,9 @@ jobs: - name: Install NPM packages run: npm ci - - name: Gatsby Cache Folder - uses: actions/cache@v3 + - uses: jongwooo/gatsby-cache@v1.1.0 with: - key: cache-folder-${{ matrix.os }} - path: .cache - - - name: Gatsby Public Folder - uses: actions/cache@v3 - with: - key: public-folder-${{ matrix.os }} - path: public + key: pull-request-gatsby-ubuntu-latest - name: Build Gatsby run: npm run build-ci diff --git a/.github/workflows/sync-api.yml b/.github/workflows/sync-api.yml index c1d8b3ec55..0c2dce8c1b 100644 --- a/.github/workflows/sync-api.yml +++ b/.github/workflows/sync-api.yml @@ -34,17 +34,9 @@ jobs: - name: Lint Markdown files run: npm run lint:md - - name: Gatsby Cache Folder - uses: actions/cache@v3 + - uses: jongwooo/gatsby-cache@v1.1.0 with: - key: cache-folder-ubuntu-latest - path: .cache - - - name: Gatsby Public Folder - uses: actions/cache@v3 - with: - key: public-folder-ubuntu-latest - path: public + key: sync-api-gatsby-ubuntu-latest - name: Build Gatsby run: npm run build-ci