diff --git a/.github/workflows/nextjs.yml b/.github/workflows/nextjs.yml new file mode 100644 index 00000000..11d92314 --- /dev/null +++ b/.github/workflows/nextjs.yml @@ -0,0 +1,49 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + - name: Install pnpm + uses: pnpm/action-setup@v4 + with: + version: 9 + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: '20' + cache: 'pnpm' + + - name: Install pnpm + run: npm install -g pnpm + + - name: Install dependencies + run: pnpm install + + - name: Cache pnpm store + uses: actions/cache@v3 + with: + path: ~/.pnpm-store + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store- + + - name: Cache Next.js build + uses: actions/cache@v3 + with: + path: .next/cache + key: ${{ runner.os }}-nextjs-cache-${{ hashFiles('**/*') }} + restore-keys: | + ${{ runner.os }}-nextjs-cache- + + - name: Build Next.js + run: pnpm run build