Add app-astro component: landing
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
parent
213c11e0d3
commit
cac59379de
@ -9,6 +9,33 @@ clone:
|
||||
|
||||
steps:
|
||||
# COMPONENT_STEPS_BELOW
|
||||
|
||||
# Woodpecker CI step for landing Astro app
|
||||
# Add this step to your .woodpecker.yml
|
||||
|
||||
build-landing:
|
||||
image: woodpeckerci/plugin-kaniko
|
||||
settings:
|
||||
registry: registry.threesix.ai
|
||||
repo: tree-test-1770068050/landing
|
||||
tags:
|
||||
- latest
|
||||
- ${CI_COMMIT_SHA:0:8}
|
||||
context: .
|
||||
dockerfile: apps/landing/Dockerfile
|
||||
cache: true
|
||||
skip-tls-verify: true
|
||||
when:
|
||||
branch: main
|
||||
event: push
|
||||
|
||||
deploy-landing:
|
||||
image: bitnami/kubectl:latest
|
||||
commands:
|
||||
- kubectl set image deployment/tree-test-1770068050-landing landing=registry.threesix.ai/tree-test-1770068050/landing:${CI_COMMIT_SHA:0:8} -n projects || echo "Deployment not found, skipping"
|
||||
when:
|
||||
branch: main
|
||||
event: push
|
||||
# Do not remove the marker above - component steps are inserted here
|
||||
|
||||
verify:
|
||||
|
||||
@ -46,4 +46,7 @@ tree-test-1770068050/
|
||||
|
||||
## Components
|
||||
|
||||
<!-- Components will be listed here as they're added -->
|
||||
| Component | Type | Path |
|
||||
|-----------|------|------|
|
||||
| **landing** | Astro app | `apps/landing/` |
|
||||
|
||||
|
||||
1
Procfile
1
Procfile
@ -1,2 +1,3 @@
|
||||
# Local development processes
|
||||
# Components will be added below as they're created
|
||||
landing: cd apps/landing && npm run dev
|
||||
|
||||
21
apps/landing/.eslintrc.cjs
Normal file
21
apps/landing/.eslintrc.cjs
Normal file
@ -0,0 +1,21 @@
|
||||
module.exports = {
|
||||
root: true,
|
||||
extends: [
|
||||
'eslint:recommended',
|
||||
'plugin:astro/recommended',
|
||||
],
|
||||
overrides: [
|
||||
{
|
||||
files: ['*.astro'],
|
||||
parser: 'astro-eslint-parser',
|
||||
parserOptions: {
|
||||
parser: '@typescript-eslint/parser',
|
||||
extraFileExtensions: ['.astro'],
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ['*.ts', '*.mts'],
|
||||
parser: '@typescript-eslint/parser',
|
||||
},
|
||||
],
|
||||
};
|
||||
34
apps/landing/Dockerfile
Normal file
34
apps/landing/Dockerfile
Normal file
@ -0,0 +1,34 @@
|
||||
# Build stage - using pnpm for workspace dependency resolution
|
||||
FROM node:20-alpine AS build
|
||||
|
||||
# Install pnpm
|
||||
RUN npm install -g pnpm
|
||||
|
||||
WORKDIR /workspace
|
||||
|
||||
# Copy workspace configuration files
|
||||
COPY pnpm-workspace.yaml package.json pnpm-lock.yaml* ./
|
||||
|
||||
# Copy shared packages (required for workspace:* dependencies)
|
||||
COPY packages/ ./packages/
|
||||
|
||||
# Copy the app component
|
||||
COPY apps/landing/ ./apps/landing/
|
||||
|
||||
# Install dependencies using pnpm (resolves workspace:* correctly)
|
||||
RUN pnpm install --frozen-lockfile || pnpm install
|
||||
|
||||
# Build the app
|
||||
WORKDIR /workspace/apps/landing
|
||||
RUN pnpm build
|
||||
|
||||
# Production stage
|
||||
FROM nginx:alpine
|
||||
|
||||
# Copy built assets
|
||||
COPY --from=build /workspace/apps/landing/dist /usr/share/nginx/html
|
||||
COPY apps/landing/nginx.conf /etc/nginx/conf.d/default.conf
|
||||
|
||||
EXPOSE 3001
|
||||
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
10
apps/landing/astro.config.mjs
Normal file
10
apps/landing/astro.config.mjs
Normal file
@ -0,0 +1,10 @@
|
||||
import { defineConfig } from 'astro/config';
|
||||
import tailwind from '@astrojs/tailwind';
|
||||
|
||||
export default defineConfig({
|
||||
integrations: [tailwind()],
|
||||
output: 'static',
|
||||
server: {
|
||||
port: 3001,
|
||||
},
|
||||
});
|
||||
6
apps/landing/component.yaml
Normal file
6
apps/landing/component.yaml
Normal file
@ -0,0 +1,6 @@
|
||||
name: landing
|
||||
type: app
|
||||
port: 3001
|
||||
path: apps/landing
|
||||
stack: astro
|
||||
dependencies: []
|
||||
26
apps/landing/nginx.conf
Normal file
26
apps/landing/nginx.conf
Normal file
@ -0,0 +1,26 @@
|
||||
server {
|
||||
listen 3001;
|
||||
server_name localhost;
|
||||
root /usr/share/nginx/html;
|
||||
index index.html;
|
||||
|
||||
# Gzip compression
|
||||
gzip on;
|
||||
gzip_types text/plain text/css application/json application/javascript text/xml application/xml;
|
||||
|
||||
# Cache static assets
|
||||
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2)$ {
|
||||
expires 1y;
|
||||
add_header Cache-Control "public, immutable";
|
||||
}
|
||||
|
||||
# SPA fallback
|
||||
location / {
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
|
||||
# Security headers
|
||||
add_header X-Frame-Options "SAMEORIGIN" always;
|
||||
add_header X-Content-Type-Options "nosniff" always;
|
||||
add_header X-XSS-Protection "1; mode=block" always;
|
||||
}
|
||||
27
apps/landing/package.json
Normal file
27
apps/landing/package.json
Normal file
@ -0,0 +1,27 @@
|
||||
{
|
||||
"name": "landing",
|
||||
"type": "module",
|
||||
"version": "0.0.1",
|
||||
"scripts": {
|
||||
"dev": "astro dev --port 3001",
|
||||
"start": "astro dev --port 3001",
|
||||
"build": "astro build",
|
||||
"preview": "astro preview --port 3001",
|
||||
"lint": "eslint . --ext .js,.mjs,.ts,.astro",
|
||||
"format": "prettier --write ."
|
||||
},
|
||||
"dependencies": {
|
||||
"@tree-test-1770068050/logger": "workspace:*",
|
||||
"astro": "^4.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@astrojs/tailwind": "^5.0.0",
|
||||
"@typescript-eslint/parser": "^7.13.1",
|
||||
"astro-eslint-parser": "^0.16.0",
|
||||
"eslint": "^8.57.0",
|
||||
"eslint-plugin-astro": "^0.34.0",
|
||||
"prettier": "^3.2.0",
|
||||
"prettier-plugin-astro": "^0.13.0",
|
||||
"tailwindcss": "^3.4.0"
|
||||
}
|
||||
}
|
||||
4
apps/landing/public/favicon.svg
Normal file
4
apps/landing/public/favicon.svg
Normal file
@ -0,0 +1,4 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 128 128">
|
||||
<path d="M50.4 78.5a75.1 75.1 0 0 0-28.5 6.9l24.2-65.7c.7-2 1.9-3.2 3.4-3.2h29c1.5 0 2.7 1.2 3.4 3.2l24.2 65.7s-11.6-7-28.5-7L67 45.5c-.4-1.7-1.6-2.8-2.9-2.8-1.3 0-2.5 1.1-2.9 2.8L50.4 78.5z" fill="#fff"/>
|
||||
<path d="M90.9 110.8c-7.6 3-21.3 6-37 6S30.5 113.8 23 110.8L32.8 97a150.3 150.3 0 0 1 31.2-3c11.2 0 22.2.7 31.2 3l9.7 13.8z" fill="#ff5d01"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 434 B |
25
apps/landing/src/layouts/Layout.astro
Normal file
25
apps/landing/src/layouts/Layout.astro
Normal file
@ -0,0 +1,25 @@
|
||||
---
|
||||
interface Props {
|
||||
title: string;
|
||||
description?: string;
|
||||
}
|
||||
|
||||
const { title, description = 'tree-test-1770068050 - landing' } = Astro.props;
|
||||
---
|
||||
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="description" content={description} />
|
||||
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
||||
<title>{title}</title>
|
||||
</head>
|
||||
<body class="min-h-screen bg-slate-900 text-slate-100 antialiased">
|
||||
<slot />
|
||||
<script>
|
||||
import '../lib/logger';
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
13
apps/landing/src/lib/logger.ts
Normal file
13
apps/landing/src/lib/logger.ts
Normal file
@ -0,0 +1,13 @@
|
||||
import { createLogger, installGlobalHandlers } from '@tree-test-1770068050/logger';
|
||||
|
||||
export const logger = createLogger({
|
||||
level: import.meta.env.DEV ? 'debug' : 'info',
|
||||
service: 'landing',
|
||||
// Set endpoint to send logs to your backend:
|
||||
// endpoint: '/api/logs',
|
||||
});
|
||||
|
||||
// Install global error handlers (client-side only)
|
||||
if (typeof window !== 'undefined') {
|
||||
installGlobalHandlers(logger);
|
||||
}
|
||||
37
apps/landing/src/pages/index.astro
Normal file
37
apps/landing/src/pages/index.astro
Normal file
@ -0,0 +1,37 @@
|
||||
---
|
||||
import Layout from '../layouts/Layout.astro';
|
||||
---
|
||||
|
||||
<Layout title="landing | tree-test-1770068050">
|
||||
<main class="min-h-screen bg-gradient-to-br from-slate-900 to-slate-800">
|
||||
<div class="container mx-auto px-4 py-16">
|
||||
<div class="text-center">
|
||||
<h1 class="text-5xl font-bold text-white mb-6">
|
||||
landing
|
||||
</h1>
|
||||
<p class="text-xl text-slate-300 mb-8 max-w-2xl mx-auto">
|
||||
Welcome to your Astro app. This is part of the
|
||||
<code class="bg-slate-700 px-2 py-1 rounded">tree-test-1770068050</code> monorepo.
|
||||
</p>
|
||||
<p class="text-slate-400 mb-8">
|
||||
Edit this file at
|
||||
<code class="bg-slate-700 px-2 py-1 rounded">apps/landing/src/pages/index.astro</code>
|
||||
</p>
|
||||
<div class="flex gap-4 justify-center">
|
||||
<a
|
||||
href="https://docs.astro.build"
|
||||
class="px-6 py-3 bg-purple-600 text-white rounded-lg hover:bg-purple-700 transition"
|
||||
>
|
||||
Astro Docs
|
||||
</a>
|
||||
<a
|
||||
href="{{GIT_URL}}"
|
||||
class="px-6 py-3 bg-slate-700 text-white rounded-lg hover:bg-slate-600 transition"
|
||||
>
|
||||
View Source
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
</Layout>
|
||||
8
apps/landing/tailwind.config.mjs
Normal file
8
apps/landing/tailwind.config.mjs
Normal file
@ -0,0 +1,8 @@
|
||||
/** @type {import('tailwindcss').Config} */
|
||||
export default {
|
||||
content: ['./src/**/*.{astro,html,js,jsx,md,mdx,svelte,ts,tsx,vue}'],
|
||||
theme: {
|
||||
extend: {},
|
||||
},
|
||||
plugins: [],
|
||||
};
|
||||
Loading…
Reference in New Issue
Block a user