Skip to content

Commit

Permalink
Next app
Browse files Browse the repository at this point in the history
  • Loading branch information
hallipr committed Mar 23, 2024
1 parent ada35f2 commit c8f4e7f
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: ./build
path: ./out
- name: deploy to github pages
id: deployment
uses: actions/deploy-pages@v1
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
/coverage

# production
/build
/out

# misc
.DS_Store
Expand Down
13 changes: 7 additions & 6 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,21 @@ try {
$ENV:PUBLIC_URL = "/new-app"
LogCommand { npm run build -ws --if-present }

if (Test-Path "./build") {
Remove-Item -Recurse -Force build
$outFolder = "./out"
if (Test-Path $outFolder) {
Remove-Item -Recurse -Force $outFolder
}

New-Item -ItemType Directory -Path "./build" | Out-Null
$outFolder = New-Item -ItemType Directory -Path $outFolder

Write-Host "Copy react site to build/new-app folder"
Copy-Item -Path "./new-app/build" -Destination "./build/new-app" -Recurse -Force | Out-Null
Copy-Item -Path "./new-app/out" -Destination "$outFolder/new-app" -Recurse -Force | Out-Null

Write-Host "Copy static site to build/breeding folder"
Copy-Item -Path "./breeding" -Destination "./build/breeding" -Recurse -Force | Out-Null
Copy-Item -Path "./breeding" -Destination "$outFolder/breeding" -Recurse -Force | Out-Null

Write-Host "Copy static index to build folder"
Copy-Item -Path "./index.html" -Destination "./build" -Recurse -Force | Out-Null
Copy-Item -Path "./index.html" -Destination $outFolder | Out-Null
}
finally {
Pop-Location
Expand Down
5 changes: 4 additions & 1 deletion new-app/next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
/** @type {import('next').NextConfig} */
const nextConfig = {};
const nextConfig = {
output: 'export',
basePath: '/new-app',
};

export default nextConfig;

0 comments on commit c8f4e7f

Please sign in to comment.