diff --git a/.forgejo/workflows/deploy.yml b/.forgejo/workflows/deploy.yml index c96ca61..06a561d 100644 --- a/.forgejo/workflows/deploy.yml +++ b/.forgejo/workflows/deploy.yml @@ -18,6 +18,14 @@ jobs: uses: https://github.com/pnpm/action-setup@v3.0.0 with: version: 8 + - uses: actions/cache@v4 + with: + path: | + ~/.npm + ${{ github.workspace }}/.next/cache + key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }} + restore-keys: | + ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}- - name: Build run: | pnpm install diff --git a/next.config.js b/next.config.js index a746b71..1c11630 100644 --- a/next.config.js +++ b/next.config.js @@ -1,6 +1,8 @@ const path = require('path'); const createMDX = require('@next/mdx'); +const isProd = process.env.NODE_ENV === 'production'; + /** @type {import('next').NextConfig} */ const nextConfig = { output: 'export', @@ -8,7 +10,8 @@ const nextConfig = { pageExtensions: [ 'js', 'jsx', 'md', 'mdx', 'ts', 'tsx' ], sassOptions: { includePaths: [ path.join(__dirname, 'styles') ] - } + }, + assetPrefix: isProd ? 'https://raw.theclashfruit.me/flint/website/pages' : undefined }; module.exports = createMDX({