From e1295fde27a40fd72866c004e8caa6d1fce312dc Mon Sep 17 00:00:00 2001 From: Dosugamea Date: Fri, 19 Jan 2024 00:21:52 +0900 Subject: [PATCH 1/4] feat(ci): Create nuxtjs.yml --- .github/workflows/nuxtjs.yml | 78 ++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 .github/workflows/nuxtjs.yml diff --git a/.github/workflows/nuxtjs.yml b/.github/workflows/nuxtjs.yml new file mode 100644 index 0000000..6857410 --- /dev/null +++ b/.github/workflows/nuxtjs.yml @@ -0,0 +1,78 @@ +# Sample workflow for building and deploying a Nuxt site to GitHub Pages +# +# To get started with Nuxt see: https://nuxtjs.org/docs/get-started/installation +# +name: Deploy Nuxt site to Pages + +on: + # Runs on pushes targeting the default branch + push: + branches: ["main"] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + # Build job + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - uses: pnpm/action-setup@v2 + with: + version: 8.14.0 + - run: pnpm i --frozen-lockfile + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: "20" + - name: Setup Pages + uses: actions/configure-pages@v4 + with: + # Automatically inject router.base in your Nuxt configuration file and set + # target to static (https://nuxtjs.org/docs/configuration-glossary/configuration-target/). + # + # You may remove this line if you want to manage the configuration yourself. + static_site_generator: nuxt + - name: Restore cache + uses: actions/cache@v3 + with: + path: | + dist + .nuxt + key: ${{ runner.os }}-nuxt-build-${{ hashFiles('dist') }} + restore-keys: | + ${{ runner.os }}-nuxt-build- + - name: Install dependencies + run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }} + - name: Static HTML export with Nuxt + run: ${{ steps.detect-package-manager.outputs.manager }} run generate + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: ./dist + + # Deployment job + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 From 3cc287c055f873d6f487b69d32636a2dbc7a3835 Mon Sep 17 00:00:00 2001 From: Dosugamea Date: Fri, 19 Jan 2024 00:24:04 +0900 Subject: [PATCH 2/4] fix(ci): Update nuxtjs.yml fix wrong flows --- .github/workflows/nuxtjs.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/nuxtjs.yml b/.github/workflows/nuxtjs.yml index 6857410..85da425 100644 --- a/.github/workflows/nuxtjs.yml +++ b/.github/workflows/nuxtjs.yml @@ -34,7 +34,6 @@ jobs: - uses: pnpm/action-setup@v2 with: version: 8.14.0 - - run: pnpm i --frozen-lockfile - name: Setup Node uses: actions/setup-node@v4 with: @@ -57,9 +56,9 @@ jobs: restore-keys: | ${{ runner.os }}-nuxt-build- - name: Install dependencies - run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }} + run: pnpm i --frozen-lockfile - name: Static HTML export with Nuxt - run: ${{ steps.detect-package-manager.outputs.manager }} run generate + run: pnpm run generate - name: Upload artifact uses: actions/upload-pages-artifact@v3 with: From 6906cec295774d530c0bd7ca97379593212f7aa0 Mon Sep 17 00:00:00 2001 From: Dosugamea Date: Fri, 19 Jan 2024 00:49:21 +0900 Subject: [PATCH 3/4] fix(ci): Update nuxtjs.yml why it makes empty pages??? --- .github/workflows/nuxtjs.yml | 26 +++++++------------------- 1 file changed, 7 insertions(+), 19 deletions(-) diff --git a/.github/workflows/nuxtjs.yml b/.github/workflows/nuxtjs.yml index 85da425..65501a1 100644 --- a/.github/workflows/nuxtjs.yml +++ b/.github/workflows/nuxtjs.yml @@ -31,34 +31,22 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 + - name: Setup Pages + uses: actions/configure-pages@v4 with: - version: 8.14.0 + static_site_generator: nuxt - name: Setup Node uses: actions/setup-node@v4 with: node-version: "20" - - name: Setup Pages - uses: actions/configure-pages@v4 - with: - # Automatically inject router.base in your Nuxt configuration file and set - # target to static (https://nuxtjs.org/docs/configuration-glossary/configuration-target/). - # - # You may remove this line if you want to manage the configuration yourself. - static_site_generator: nuxt - - name: Restore cache - uses: actions/cache@v3 + - name: Setup pnpm + uses: pnpm/action-setup@v2 with: - path: | - dist - .nuxt - key: ${{ runner.os }}-nuxt-build-${{ hashFiles('dist') }} - restore-keys: | - ${{ runner.os }}-nuxt-build- + version: 8.14.0 - name: Install dependencies run: pnpm i --frozen-lockfile - name: Static HTML export with Nuxt - run: pnpm run generate + run: pnpm generate - name: Upload artifact uses: actions/upload-pages-artifact@v3 with: From 658d3c5efc550bbbace76e914fe562af879d4652 Mon Sep 17 00:00:00 2001 From: Dosugamea Date: Fri, 19 Jan 2024 00:59:06 +0900 Subject: [PATCH 4/4] fix(ci): Update nuxtjs.yml --- .github/workflows/nuxtjs.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/nuxtjs.yml b/.github/workflows/nuxtjs.yml index 65501a1..6b6f907 100644 --- a/.github/workflows/nuxtjs.yml +++ b/.github/workflows/nuxtjs.yml @@ -32,9 +32,7 @@ jobs: - name: Checkout uses: actions/checkout@v4 - name: Setup Pages - uses: actions/configure-pages@v4 - with: - static_site_generator: nuxt + uses: actions/configure-pages@v1 - name: Setup Node uses: actions/setup-node@v4 with: @@ -46,7 +44,7 @@ jobs: - name: Install dependencies run: pnpm i --frozen-lockfile - name: Static HTML export with Nuxt - run: pnpm generate + run: NUXT_APP_CDN_URL=https://dosugamea.github.io/ pnpm generate - name: Upload artifact uses: actions/upload-pages-artifact@v3 with: