Skip to content

Commit b111542

Browse files
committed
base url added while deploy
1 parent dac46c3 commit b111542

File tree

1 file changed

+19
-33
lines changed

1 file changed

+19
-33
lines changed

.github/workflows/ci.yml

Lines changed: 19 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,50 @@
1-
name: CI
1+
name: Deploy Static Site to GitHub Pages
22

33
on:
44
push:
55
branches:
66
- master
7-
87
pull_request:
98
branches:
109
- master
1110

1211
jobs:
13-
build:
14-
strategy:
15-
fail-fast: false
16-
runs-on: ubuntu-latest
17-
steps:
18-
- uses: actions/checkout@v4
19-
20-
- name: Install pnpm
21-
uses: pnpm/action-setup@v4
22-
with:
23-
run_install: false
24-
25-
- uses: actions/setup-node@v4
26-
with:
27-
node-version: lts/*
28-
cache: pnpm
29-
30-
- name: Install dependencies
31-
run: pnpm install --frozen-lockfile
32-
33-
- name: Build
34-
run: pnpm run build
35-
36-
generate:
37-
strategy:
38-
fail-fast: false
12+
# This single job handles installing dependencies, generating the static site, and deploying it.
13+
deploy_pages:
3914
runs-on: ubuntu-latest
4015
steps:
41-
- uses: actions/checkout@v4
16+
- name: Checkout Repository
17+
uses: actions/checkout@v4
4218

4319
- name: Install pnpm
4420
uses: pnpm/action-setup@v4
4521
with:
46-
run_install: false
22+
run_install: false # Skip initial install here
4723

48-
- uses: actions/setup-node@v4
24+
- name: Setup Node.js
25+
uses: actions/setup-node@v4
4926
with:
5027
node-version: lts/*
5128
cache: pnpm
5229

53-
- name: Install dependencies
30+
- name: Install Dependencies
31+
# Using --frozen-lockfile ensures reproducible builds
5432
run: pnpm install --frozen-lockfile
5533

56-
- name: Generate
34+
- name: Generate Static Site
35+
# This step runs your "generate" script: "nuxt prepare && nuxt generate www"
36+
# This command is responsible for generating files into 'www/.output/public'
37+
env:
38+
NUXT_APP_BASE_URL: /comforterpdocsnuxt/ # Setting the BASE_URL environment variable for Nuxt
5739
run: pnpm run generate
5840

5941
- name: Deploy to GitHub Pages
42+
# This action pushes the generated content to the 'gh-pages' branch
6043
uses: peaceiris/actions-gh-pages@v3
6144
with:
6245
github_token: ${{ secrets.GITHUB_TOKEN }}
46+
# Ensure this path matches the output of 'nuxt generate www'
6347
publish_dir: www/.output/public
6448
publish_branch: gh-pages
49+
# Optional: Add a custom commit message
50+
commit_message: Deploying static Nuxt site to gh-pages

0 commit comments

Comments
 (0)