Skip to content

Set up NextJS build cache for faster GitHub Actions build times

License

Notifications You must be signed in to change notification settings

brianespinosa/next-build-cache

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

next-build-cache

Last Updated License: MIT

Set up NextJS build cache for faster GitHub Actions build times

brianespinosa/next-build-cache@main

Usage

name: CI

on:
  push:
    branches: [main]
  pull_request:

concurrency:
  group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
  cancel-in-progress: true

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: brianespinosa/checkout-setup-node-install@main
      - uses: brianespinosa/next-build-cache@main
      - run: yarn build

Assumptions

  • We are handling install caching with other tools like node-setup or brianespinosa/checkout-setup-node-install
  • We are using yarn as our package manager so we can leverage a yarn.lock file to generate part of our build cache hash
  • This action runs immediately before a NextJS build command to look for a build cache (post-job actions will automatically save the build cache upon build completion)

About

Set up NextJS build cache for faster GitHub Actions build times

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published