Skip to content

Commit

Permalink
Update GitHub Actions workflow 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 11b8e76
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 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,9 @@ 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

0 comments on commit 11b8e76

Please sign in to comment.