Skip to content

Commit

Permalink
ci: update
Browse files Browse the repository at this point in the history
  • Loading branch information
psucodervn committed Sep 26, 2023
1 parent a098519 commit c92d589
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,11 @@
const isGithubActions = process.env.GITHUB_ACTIONS || false

let assetPrefix = ''
let basePath = '/'

if (isGithubActions) {
// trim off `<owner>/`
const repo = process.env.GITHUB_REPOSITORY.replace(/.*?\//, '')

assetPrefix = `/${repo}/`
basePath = `/${repo}`
}
const repo = (process.env.GITHUB_REPOSITORY || '').replace(/.*?\//, '')

/** @type {import('next').NextConfig} */
const nextConfig = {
output: isGithubActions ? 'export' : 'standalone',
assetPrefix,
basePath,
assetPrefix: isGithubActions ? `/${repo}/` : undefined,
basePath: isGithubActions ? `/${repo}` : undefined,
}

module.exports = nextConfig

0 comments on commit c92d589

Please sign in to comment.