Skip to content

Commit 7f3f6fe

Browse files
committed
hrm docs - deploy updates
1 parent e39f62d commit 7f3f6fe

File tree

7 files changed

+59
-11
lines changed

7 files changed

+59
-11
lines changed

.github/workflows/ci.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Deploy Static Site to GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
11+
jobs:
12+
# This single job handles installing dependencies, generating the static site, and deploying it.
13+
deploy_pages:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout Repository
17+
uses: actions/checkout@v4
18+
19+
- name: Install pnpm
20+
uses: pnpm/action-setup@v4
21+
with:
22+
run_install: false # Skip initial install here
23+
24+
- name: Setup Node.js
25+
uses: actions/setup-node@v4
26+
with:
27+
node-version: lts/*
28+
cache: pnpm
29+
30+
- name: Install Dependencies
31+
# Using --frozen-lockfile ensures reproducible builds
32+
run: pnpm install --frozen-lockfile
33+
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: /comforthrmdocsnuxt/ # Setting the BASE_URL environment variable for Nuxt
39+
run: pnpm run generate
40+
41+
- name: Deploy to GitHub Pages
42+
# This action pushes the generated content to the 'gh-pages' branch
43+
uses: peaceiris/actions-gh-pages@v3
44+
with:
45+
github_token: ${{ secrets.GITHUB_TOKEN }}
46+
# Ensure this path matches the output of 'nuxt generate www'
47+
publish_dir: www/.output/public
48+
publish_branch: gh-pages
49+
# Optional: Add a custom commit message
50+
commit_message: Deploying static Nuxt site to gh-pages

components/OgImage/ShadcnDocs.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
:style="`background-size: 120px 120px; background-image: linear-gradient(to right, ${colorMode === 'light' ? '#e5e7eb' : '#27272a'} 1px, transparent 1px), linear-gradient(to bottom, ${colorMode === 'light' ? '#e5e7eb' : '#27272a'} 1px, transparent 1px);`"
66
>
77
<div class="mb-4 flex">
8-
<img v-if="colorMode === 'light'" :src="logo.light" height="65" />
9-
<img v-else :src="logo.dark" height="65" />
8+
<NuxtImg v-if="colorMode === 'light'" :src="logo.light" height="65" />
9+
<NuxtImg v-else :src="logo.dark" height="65" />
1010
<span
1111
v-if="showTitle && siteTitle"
1212
class="ml-4 self-center text-4xl font-bold"

components/content/FeaturesSection.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111
<CardContentCustom class="flex flex-col items-center">
1212
<div class="mb-6 flex h-20 w-20 items-center justify-center rounded-2xl bg-primary/10 p-3 group-hover:bg-primary/20 transition-colors">
1313
<template v-if="feature?.icon">
14-
<img
14+
<NuxtImg
1515
:src="feature.icon.light || '/placeholder-icon-light.png'"
1616
:alt="feature.icon.alt || feature.title"
1717
class="h-10 w-10 object-contain dark:hidden"
1818
/>
19-
<img
19+
<NuxtImg
2020
:src="feature.icon.dark || feature.icon.light || '/placeholder-icon-dark.png'"
2121
:alt="feature.icon.alt || feature.title"
2222
class="hidden h-10 w-10 object-contain dark:block"

components/content/HeroAltCustom.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,12 @@
4949
<div class="flex items-center justify-center order-first md:order-last">
5050
<div class="flex flex-col items-center gap-4">
5151
<div class="flex items-center justify-center rounded-2xl bg-muted/20">
52-
<img
52+
<NuxtImg
5353
:src="logo?.light"
5454
:alt="logo?.alt"
5555
class="h-80 w-80 object-contain dark:hidden"
5656
/>
57-
<img
57+
<NuxtImg
5858
:src="logo?.dark || logo?.light"
5959
:alt="logo?.alt"
6060
class="hidden h-80 w-80 object-contain dark:block"

nuxt.config.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,14 @@ import tailwindcss from '@tailwindcss/vite';
44

55
const currentDir = dirname(fileURLToPath(import.meta.url));
66

7-
//const base = process.env.NUXT_APP_BASE_URL || '/comforthrmdocsnuxt/';
8-
97
export default defineNuxtConfig({
108
nitro: {
119
//preset: 'github-pages',
1210
preset: process.env.PRESET,
1311
},
1412
app: {
15-
//baseURL: '/comforthrmdocsnuxt/'
1613
//baseURL: process.env.BASE_URL || '/comforthrmdocsnuxt/',
17-
baseURL: process.env.BASE_URL,
14+
baseURL: process.env.NUXT_APP_BASE_URL ?? '/',
1815
head: {
1916
link: [
2017
{ rel: 'icon', type: 'image/svg', href: '/logo_icon_brand_512.png' },

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,9 @@
3838
"scripts": {
3939
"build": "nuxt prepare && nuxt build www",
4040
"dev": "nuxt prepare && nuxt dev www",
41+
"generate": "nuxt prepare && nuxt generate www",
4142
"generate2": "nuxt prepare && nuxt generate www",
42-
"generate": "nuxt prepare && NUXT_APP_BASE_URL=/comforthrmdocsnuxt/ nuxt generate --preset github_pages",
43+
"generate3": "nuxt prepare && NUXT_APP_BASE_URL=/comforthrmdocsnuxt/ nuxt generate --preset github_pages || echo 'Ignoring prerender errors'",
4344
"preview": "nuxt prepare && nuxt preview www",
4445
"typecheck": "nuxt prepare && nuxt typecheck",
4546
"lint": "eslint .",
File renamed without changes.

0 commit comments

Comments
 (0)