Skip to content

Commit

Permalink
Update GitHub Actions caching mechanism
Browse files Browse the repository at this point in the history
  • Loading branch information
wxh06 committed Aug 13, 2023
1 parent 1c78b5b commit 7fff961
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Build artifacts

on:
push:
branches: ["main"]
branches: [main]

jobs:
build:
Expand All @@ -28,7 +28,7 @@ jobs:
- name: Use Node.js LTS
uses: actions/setup-node@v3
with:
node-version: "lts/*"
node-version: lts/*
cache: pnpm

- name: Install dependencies
Expand All @@ -37,8 +37,11 @@ jobs:
- name: Next.js build cache
uses: actions/cache@v3
with:
path: packages/viewer/.next/
key: ${{ runner.os }}-next
path: packages/viewer/.next/cache/
key: ${{ runner.os }}-nextjs-${{ hashFiles('pnpm-lock.yaml') }}-${{ hashFiles('packages/viewer/**/*.[jt]s', 'packages/viewer/**/*.[jt]sx') }}
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('pnpm-lock.yaml') }}-
${{ runner.os }}-nextjs-
- name: Build
run: pnpm -r run build
Expand All @@ -48,11 +51,11 @@ jobs:
with:
name: luogu-discussion-archive
path: packages/archive/dist/
retention-days: 1

- name: Upload luogu-discussion-viewer
uses: actions/upload-artifact@v3
with:
name: luogu-discussion-viewer
path: packages/viewer/.next/
retention-days: 1
path: |
packages/viewer/.next/
!packages/viewer/.next/cache/

0 comments on commit 7fff961

Please sign in to comment.