Skip to main content
GoodFirstPicks
DashboardIssuesReposLeaderboard

GoodFirstPicks by Leaveitblank © 2026

CreatorRequest a RepoPrivacy PolicyTerms of Service
"No build cache found" on Ubuntu Instance with Github Actions | GoodFirstPicks

"No build cache found" on Ubuntu Instance with Github Actions

vercel/next.js 9 comments 25d ago
View on GitHub
mediumopenScope: somewhat clearSkill match: maybeNext.jsTypeScriptReact

Why this is a good first issue

Cache configuration issue in GitHub Actions workflow.

AI Summary

The issue involves a GitHub Actions workflow where the Next.js build cache is not being detected despite proper configuration. The problem seems related to cache setup or potential directory clearing before the build. The solution requires understanding GitHub Actions caching and Next.js build processes.

Issue Description

Link to the code that reproduces this issue

https://github.com/RebootGG/va-frontend

To Reproduce

I'm building and deploying the app via Github actions, on an instance.

Here is my .github/workflow.yml file :

name: Deploy to Server

on:
  push:
    branches:
      - master

jobs:
  deploy:
    runs-on: self-hosted
    steps:
      - name: Cache Node.js modules
        uses: actions/cache@v3
        with:
          path: |
            ~/.npm
            ${{ github.workspace }}/.next/cache
          # Generate a new cache whenever packages or source files change.
          key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }}
          # If source files changed but packages didn't, rebuild from a prior cache.
          restore-keys: |
            ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-    
      
      - name: Checkout
        uses: actions/checkout@v4
        with:
          ssh-key: ${{ secrets.SSH_KEY }}
          
      - name: Execute Deployment Commands
        run: |
          git pull origin master
          npm install
          npm run build
          pm2 restart all

Current vs. Expected behavior

Even though i'm using the instructions from the docs, I still get the following message during the "npm run build" command:

> build
> next build

⚠ No build cache found. Please configure build caching for faster rebuilds. Read more: https://nextjs.org/docs/messages/no-cache

I would expect Next.js to retrieve the cache from the previous builds.

Verify canary release

  • I verified that the issue exists in the latest Next.js canary release

Provide environment information

Operating System:
  Platform: linux
  Arch: x64
  Version: #99-Ubuntu SMP Mon Oct 3

GitHub Labels

bug

Want to work on this?

Claim this issue to let others know you're working on it. You'll earn 20 points when you complete it!

Risk Flags

  • self-hosted runner
  • cache configuration
Loading labels...

Details

Points20 pts
Difficultymedium
Scopesomewhat clear
Skill Matchmaybe
Test Focusedno