Skip to content

Commit

Permalink
fix pages build
Browse files Browse the repository at this point in the history
  • Loading branch information
morewings committed May 17, 2024
1 parent b4b9ad5 commit bd51bdc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,18 @@ jobs:
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml') }}-
- name: Set up pages build envrinonment variable
run: |
touch .env
echo PAGES_BUILD=true >> .env
- name: Build docs
run: |
pnpm install
pnpm run build
- name: Setup Pages
uses: actions/configure-pages@v5
with:
static_site_generator: next

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
Expand Down
4 changes: 3 additions & 1 deletion next.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Enable bundle analysis. Run `pnpm run analyze:build` to get report */
/* Enable bundle analysis. Run `yarn analyze:build` to get report */
/* eslint-disable-next-line import/no-extraneous-dependencies, @typescript-eslint/no-var-requires */
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true',
Expand All @@ -9,5 +9,7 @@ module.exports = withBundleAnalyzer({
reactStrictMode: true,
swcMinify: true,
distDir: 'build',
output: process.env.PAGES_BUILD === 'true' ? 'export' : undefined,
cleanDistDir: true,
basePath: process.env.PAGES_BUILD === 'true' ? '/ts-redux-next' : undefined,
});

0 comments on commit bd51bdc

Please sign in to comment.