From c7eef54ce3b57b37f84a78bc898d368e338c248a Mon Sep 17 00:00:00 2001 From: watchakorn-18k Date: Sun, 24 Nov 2024 14:18:36 +0700 Subject: [PATCH] fix : github action file --- .github/workflows/publish.yml | 45 ++++++++++++++++++++++++++++++----- next.config.ts | 1 + 2 files changed, 40 insertions(+), 6 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 0fcda20..a244109 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,3 +1,18 @@ +name: publish-to-github-pages +on: + push: + branches: + - main + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: "pages" + cancel-in-progress: false + jobs: build: runs-on: ubuntu-latest @@ -11,16 +26,34 @@ jobs: curl -fsSL https://bun.sh/install | bash echo "${HOME}/.bun/bin" >> $GITHUB_PATH + - name: Setup Pages ⚙️ + uses: actions/configure-pages@v4 + with: + static_site_generator: next + - name: Install Dependencies with Bun 🔧 run: bun install + + - name : Check Path + run: pwd && ls - - name: Build and Export with Next.js 🏗️ - run: bun run next build && bun run next export - - - name: Check Build Output - run: ls -la + - name: Build with Next.js using Bun 🏗️ + run: pwd && bun run build - name: Upload artifact 📡 uses: actions/upload-pages-artifact@v3 with: - path: ./out + path: ./build + + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + + runs-on: ubuntu-latest + needs: build + + steps: + - name: Publish to GitHub Pages 🚀 + id: deployment + uses: actions/deploy-pages@v4 diff --git a/next.config.ts b/next.config.ts index 28d4017..04440ed 100644 --- a/next.config.ts +++ b/next.config.ts @@ -2,6 +2,7 @@ import type { NextConfig } from "next"; const nextConfig: NextConfig = { /* config options here */ + distDir: "build", output: "export", reactStrictMode: true, images: {