From 95772f4b5b9351205aa84cfc2655e731f376c241 Mon Sep 17 00:00:00 2001 From: Techit Thawiang Date: Sun, 26 Oct 2025 19:03:25 +0700 Subject: [PATCH] fix deploy for GitHub action --- .github/workflows/deploy.yml | 51 +++++++++++++++++++++++------------- 1 file changed, 33 insertions(+), 18 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index dc7638d..6a2bd8e 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -10,16 +10,26 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + with: + submodules: false + - run: corepack enable - uses: actions/setup-node@v4 with: node-version: "22" + - name: Install dependencies run: pnpm install + - name: Change content submodule URL - run: cd content/ && git remote set-url origin https://github.com/techitwinner/web-content.git && cd ../ + run: | + cd content/ + git remote set-url origin https://github.com/techitwinner/web-content.git + cd ../ + - name: Fetch contents run: git submodule update --init --remote + - name: Generate static pages run: pnpm generate env: @@ -28,24 +38,29 @@ jobs: NUXT_PUBLIC_BASE_URL: ${{ vars.NUXT_PUBLIC_BASE_URL }} NUXT_PUBLIC_SITE_AUTHOR: ${{ vars.NUXT_PUBLIC_SITE_AUTHOR }} NUXT_PUBLIC_BUILD_BASE_URL: ${{ vars.NUXT_PUBLIC_BUILD_BASE_URL }} - - name: Create ZIP artifact - run: | - zip -r web.zip ./.output/public - - name: Upload ZIP artifact - uses: actions/upload-artifact@v4 + + - name: Upload build output + uses: actions/upload-pages-artifact@v3 with: - name: web - path: web.zip - - name: Create GitHub Release - id: release - uses: ncipollo/release-action@v1 - with: - tag: ${{ github.sha }} - name: Release ${{ github.sha }} - body: Automated release for commit ${{ github.sha }} - draft: false - prerelease: false - files: web.zip + path: .output/public # Nuxt generates static site here + # - name: Create ZIP artifact + # run: | + # zip -r web.zip ./.output/public + # - name: Upload ZIP artifact + # uses: actions/upload-artifact@v4 + # with: + # name: web + # path: web.zip + # - name: Create GitHub Release + # id: release + # uses: ncipollo/release-action@v1 + # with: + # tag: ${{ github.sha }} + # name: Release ${{ github.sha }} + # body: Automated release for commit ${{ github.sha }} + # draft: false + # prerelease: false + # files: web.zip deploy: needs: build