Skip to content

Commit b689e25

Browse files
committed
Initial commit
1 parent c2910d6 commit b689e25

File tree

10 files changed

+143
-20
lines changed

10 files changed

+143
-20
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Deploy Audit to Netlify
2+
3+
on:
4+
push:
5+
branches:
6+
- audit-netlify
7+
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-24.04
11+
env:
12+
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_AUDIT_SITE_ID }}
13+
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
14+
ENV_MODE: audit
15+
PUBLIC_ENV_MODE: audit
16+
17+
steps:
18+
- uses: actions/checkout@v5
19+
20+
- uses: actions/setup-node@v6
21+
with:
22+
node-version: 24
23+
cache: npm
24+
cache-dependency-path: package-lock.json
25+
26+
- name: Install Dependencies
27+
run: npm ci
28+
29+
- name: Build with Audit Mode
30+
run: |
31+
npx vite build --mode audit
32+
npx svelte-kit build --mode audit
33+
34+
- name: Deploy to Netlify
35+
run: |
36+
npx netlify deploy \
37+
--prod \
38+
--site=$NETLIFY_SITE_ID \
39+
--auth=$NETLIFY_AUTH_TOKEN \
40+
--dir=.svelte-kit/output

_headers

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/*
2+
X-Frame-Options: DENY
3+
X-Content-Type-Options: nosniff
4+
Referrer-Policy: strict-origin-when-cross-origin
5+
Permissions-Policy: interest-cohort=()

_redirects

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/robots.txt /robots-audit.txt 200

netlify.toml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# netlify.toml
2+
#
3+
# Copyright © 2025 Network Pro Strategies (Network Pro™)
4+
# SPDX-License-Identifier: CC-BY-4.0 OR GPL-3.0-or-later
5+
# This file is part of Network Pro
6+
7+
# ============================================================================
8+
# Audit Deployment (SSR, via Netlify Functions)
9+
# ============================================================================
10+
# This config is used *only* in the audit-netlify branch.
11+
# The site is built using adapter-netlify, with SSR enabled.
12+
# ============================================================================
13+
14+
[build]
15+
command = "npm run build"
16+
publish = "build"
17+
18+
# Enable SvelteKit SSR via Netlify Functions
19+
[functions]
20+
node_bundler = "esbuild"

package-lock.json

Lines changed: 23 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@
9494
"@eslint/js": "^9.39.1",
9595
"@lhci/cli": "^0.15.1",
9696
"@playwright/test": "^1.56.1",
97+
"@sveltejs/adapter-netlify": "^5.2.4",
9798
"@sveltejs/adapter-vercel": "^6.1.1",
9899
"@sveltejs/kit": "2.48.4",
99100
"@sveltejs/vite-plugin-svelte": "^6.2.1",

scripts/merge-master.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
git checkout audit-netlify
3+
git pull origin audit-netlify
4+
git merge master --no-edit
5+
git push origin audit-netlify
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/* ==========================================================================
2+
src/routes/__audit/headers/+server.js
3+
4+
Copyright © 2025 Network Pro Strategies (Network Pro™)
5+
SPDX-License-Identifier: CC-BY-4.0 OR GPL-3.0-or-later
6+
This file is part of Network Pro.
7+
========================================================================== */
8+
9+
/**
10+
* @file +server.js
11+
* @description Audit header debug endpoint.
12+
* This route is used to verify runtime header behavior in the audit environment.
13+
* It returns a 204 No Content response with diagnostic headers.
14+
* @module src/routes/__audit/headers
15+
* @author Scott Lopez
16+
* @updated 2025-11-11
17+
*/
18+
19+
/**
20+
* @param {import('@sveltejs/kit').RequestEvent} _event - Unused request event
21+
* @returns {Response} - A 204 response with environment-specific headers
22+
*/
23+
export function GET(_event) {
24+
/** @type {HeadersInit} */
25+
const headers = {
26+
'X-Env': process.env.NODE_ENV ?? 'undefined',
27+
'X-Check': 'audit-path-active',
28+
};
29+
30+
return new Response(null, {
31+
status: 204,
32+
headers,
33+
});
34+
}

static/robots-audit.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# robots-audit.txt
2+
#
3+
# Copyright © 2025 Network Pro Strategies (Network Pro™)
4+
# SPDX-License-Identifier: CC-BY-4.0 OR GPL-3.0-or-later
5+
# This file is part of Network Pro
6+
#
7+
# www.robotstxt.org
8+
9+
User-agent: *
10+
11+
Disallow: /

svelte.config.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ SPDX-License-Identifier: CC-BY-4.0 OR GPL-3.0-or-later
66
This file is part of Network Pro.
77
========================================================================= */
88

9-
import adapter from '@sveltejs/adapter-vercel'; // Vercel adapter for deployment
9+
import adapter from '@sveltejs/adapter-netlify'; // Netlify adapter for audit deployment
1010
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte'; // Vite preprocessor for Svelte
1111

1212
/** @type {import('@sveltejs/kit').Config} */
@@ -15,10 +15,8 @@ const config = {
1515
preprocess: vitePreprocess({ postcss: true }),
1616

1717
kit: {
18-
// Vercel adapter configuration
19-
adapter: adapter({
20-
runtime: 'nodejs22.x',
21-
}),
18+
// Netlify adapter configuration (no runtime option needed)
19+
adapter: adapter(),
2220

2321
// Paths configuration for deployment
2422
paths: {

0 commit comments

Comments
 (0)