diff --git a/.github/workflows/deploy-pages.yml b/.github/workflows/deploy-pages.yml new file mode 100644 index 0000000..23dcbb6 --- /dev/null +++ b/.github/workflows/deploy-pages.yml @@ -0,0 +1,43 @@ +name: Deploy Pages + +on: + push: + branches: [main] + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: pages + cancel-in-progress: false + +jobs: + build: + runs-on: ubuntu-latest + env: + STATIC_EXPORT: 'true' + steps: + - uses: actions/checkout@v6 + - uses: actions/setup-node@v5 + with: + node-version: 20 + cache: npm + - run: npm ci + - run: npm run build + - uses: actions/configure-pages@v5 + - uses: actions/upload-pages-artifact@v3 + with: + path: out + + deploy: + needs: build + runs-on: ubuntu-latest + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - id: deployment + uses: actions/deploy-pages@v4 diff --git a/next.config.ts b/next.config.ts index 68a6c64..7de0a55 100644 --- a/next.config.ts +++ b/next.config.ts @@ -1,7 +1,10 @@ import type { NextConfig } from "next"; +const isStaticExport = process.env.STATIC_EXPORT === "true"; + const nextConfig: NextConfig = { - output: "standalone", + output: isStaticExport ? "export" : "standalone", + images: { unoptimized: isStaticExport }, }; export default nextConfig; diff --git a/public/CNAME b/public/CNAME new file mode 100644 index 0000000..0e20729 --- /dev/null +++ b/public/CNAME @@ -0,0 +1 @@ +beer.techquests.dev