Skip to content

Commit

Permalink
ops: github pages cache
Browse files Browse the repository at this point in the history
  • Loading branch information
GabenGar committed Oct 12, 2024
1 parent b321266 commit 6382810
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/pages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,30 +28,36 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "20"
cache: npm
- name: Setup Pages
uses: actions/configure-pages@v5

- name: Restore cache
uses: actions/cache@v4
with:
path: src
path: |
.next/cache
# Generate a new cache whenever packages or source files change.
key: ${{ runner.os }}-pages-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
# If source files changed but packages didn't, rebuild from a prior cache.
restore-keys: |
${{ runner.os }}-pages-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-
- name: Install dependencies
run: npm ci

- name: Build pages
run: npm run build

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./dist

# Single deploy job since we're just deploying
deploy:
environment:
Expand Down

0 comments on commit 6382810

Please sign in to comment.