diff --git a/.github/workflows/dev.docker.yml b/.github/workflows/dev.docker.yml
new file mode 100644
index 0000000..46b1410
--- /dev/null
+++ b/.github/workflows/dev.docker.yml
@@ -0,0 +1,46 @@
+name: Publish API Image (Dev)
+
+on:
+ push:
+ branches:
+ - dev
+
+permissions:
+ contents: read
+ packages: write
+
+jobs:
+ docker-build-push-dev:
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Checkout source code
+ uses: actions/checkout@v4
+
+ - name: Set up Docker Buildx
+ uses: docker/setup-buildx-action@v3
+
+ - name: Log in to GitHub Container Registry
+ uses: docker/login-action@v3
+ with:
+ registry: ghcr.io
+ username: ${{ github.actor }}
+ password: ${{ secrets.GITHUB_TOKEN }}
+
+ - name: Extract Docker metadata (Dev)
+ id: meta
+ uses: docker/metadata-action@v5
+ with:
+ images: ghcr.io/${{ github.repository_owner }}/pressiqo-land
+ tags: |
+ dev
+
+ - name: Build and push Docker image (Dev)
+ uses: docker/build-push-action@v5
+ with:
+ context: .
+ file: ./Dockerfile
+ push: true
+ platforms: linux/amd64
+ tags: ${{ steps.meta.outputs.tags }}
+ labels: ${{ steps.meta.outputs.labels }}
diff --git a/.github/workflows/build.yml b/.github/workflows/gh.build.yml
similarity index 100%
rename from .github/workflows/build.yml
rename to .github/workflows/gh.build.yml
diff --git a/.github/workflows/deploy.yml b/.github/workflows/gh.deploy.yml
similarity index 100%
rename from .github/workflows/deploy.yml
rename to .github/workflows/gh.deploy.yml
diff --git a/.github/workflows/main.docker.yml b/.github/workflows/main.docker.yml
new file mode 100644
index 0000000..0dca502
--- /dev/null
+++ b/.github/workflows/main.docker.yml
@@ -0,0 +1,48 @@
+name: Publish API Image
+
+on:
+ push:
+ branches:
+ - main
+ tags:
+ - "v*.*.*"
+
+permissions:
+ contents: read
+ packages: write
+
+jobs:
+ docker-build-push:
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Checkout source code
+ uses: actions/checkout@v4
+
+ - name: Set up Docker Buildx
+ uses: docker/setup-buildx-action@v3
+
+ - name: Log in to GitHub Container Registry
+ uses: docker/login-action@v3
+ with:
+ registry: ghcr.io
+ username: ${{ github.actor }}
+ password: ${{ secrets.GITHUB_TOKEN }}
+
+ - name: Extract Docker metadata
+ id: meta
+ uses: docker/metadata-action@v5
+ with:
+ images: ghcr.io/${{ github.repository_owner }}/pressiqo-land
+ tags: |
+ latest
+
+ - name: Build and push Docker image
+ uses: docker/build-push-action@v5
+ with:
+ context: .
+ file: ./Dockerfile
+ push: true
+ platforms: linux/amd64
+ tags: ${{ steps.meta.outputs.tags }}
+ labels: ${{ steps.meta.outputs.labels }}
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 5cd9468..78de467 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -1,33 +1,68 @@
-name: Build Only
+name: Release API
on:
push:
branches:
- - build
+ - main
+
+permissions:
+ contents: write
jobs:
- build:
+ build-and-release:
runs-on: ubuntu-latest
-
+ defaults:
+ run:
+ shell: bash
steps:
- - name: Checkout
- uses: actions/checkout@v3
+ - name: Checkout repository
+ uses: actions/checkout@v4
- - name: Setup Node
- uses: actions/setup-node@v3
+ - name: Set up Node.js
+ uses: actions/setup-node@v4
with:
- node-version: 18
+ node-version: 20
+ cache: npm
- name: Install dependencies
- run: npm ci --legacy-peer-deps
- working-directory: ./app
+ run: |
+ if [ -f package-lock.json ]; then
+ npm ci
+ else
+ npm install
+ fi
+
+ - name: Build production bundle
+ run: npm run build --if-present
- - name: Build
- run: npm run build
- working-directory: ./app
+ - name: Compute release tag
+ id: version
+ run: echo "tag=v$(date +'%Y.%m.%d')-${GITHUB_RUN_NUMBER}" >> "$GITHUB_OUTPUT"
+
+ - name: Prepare release archive
+ run: |
+ mkdir -p release
+ cp -r dist release/
+ cp package.json release/
+ [ -f package-lock.json ] && cp package-lock.json release/
+ cp tsconfig.json release/ || true
+ tar -czf pressiqo-land-${{ steps.version.outputs.tag }}.tar.gz -C release .
- name: Upload build artifact
- uses: actions/upload-artifact@v3
+ uses: actions/upload-artifact@v4
+ with:
+ name: pressiqo-land-${{ steps.version.outputs.tag }}
+ path: pressiqo-land-${{ steps.version.outputs.tag }}.tar.gz
+ retention-days: 14
+
+ - name: Publish GitHub release
+ uses: softprops/action-gh-release@v2
with:
- name: app-dist
- path: ./app/dist
\ No newline at end of file
+ tag_name: ${{ steps.version.outputs.tag }}
+ name: pressiqo.app ${{ steps.version.outputs.tag }}
+ body: |
+ Automated release for pressiqo.app
+ - Commit: ${{ github.sha }}
+ - Build: ${{ github.run_id }}
+ files: |
+ pressiqo-land-${{ steps.version.outputs.tag }}.tar.gz
diff --git a/App.tsx b/App.tsx
index 7a5fdfb..0fac0f3 100644
--- a/App.tsx
+++ b/App.tsx
@@ -25,7 +25,7 @@ const App: React.FC = () => {
-
+ {/* */}
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..0494916
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,37 @@
+# ============================
+# Stage 1: Build (Vite)
+# ============================
+FROM node:20-alpine AS builder
+
+WORKDIR /app
+
+# Install dependencies first (cache-efficient)
+COPY package.json package-lock.json ./
+RUN npm ci --legacy-peer-deps
+
+# Copy application source
+COPY . .
+
+# Build static assets
+RUN npm run build
+
+
+# ============================
+# Stage 2: Runtime (Nginx)
+# ============================
+FROM nginx:alpine
+
+# Remove default Nginx config
+RUN rm /etc/nginx/conf.d/default.conf
+
+# Copy SPA-safe Nginx config
+COPY nginx.conf /etc/nginx/conf.d/default.conf
+
+# Copy only the built assets
+COPY --from=builder /app/dist /usr/share/nginx/html
+
+# Standard HTTP port (internal only)
+EXPOSE 80
+
+# Run Nginx in foreground
+CMD ["nginx", "-g", "daemon off;"]
\ No newline at end of file
diff --git a/nginx.conf b/nginx.conf
new file mode 100644
index 0000000..c17ff2d
--- /dev/null
+++ b/nginx.conf
@@ -0,0 +1,19 @@
+server {
+ listen 80;
+ server_name _;
+
+ root /usr/share/nginx/html;
+ index index.html;
+
+ location / {
+ try_files $uri $uri/ /index.html;
+ }
+
+ # Optional but recommended
+ gzip on;
+ gzip_types
+ text/css
+ application/javascript
+ application/json
+ image/svg+xml;
+}
\ No newline at end of file
diff --git a/package-lock.json b/package-lock.json
index 13c8394..9e7eb1a 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,11 +1,11 @@
{
- "name": "www.pressiqo.app",
+ "name": "www.pressqo.com",
"version": "0.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
- "name": "www.pressiqo.app",
+ "name": "www.pressqo.com",
"version": "0.0.0",
"dependencies": {
"@google/genai": "^1.33.0",
diff --git a/package.json b/package.json
index 3cba1d0..9e4f278 100644
--- a/package.json
+++ b/package.json
@@ -1,5 +1,5 @@
{
- "name": "www.pressiqo.app",
+ "name": "www.pressqo.com",
"private": true,
"version": "0.0.0",
"type": "module",
@@ -21,4 +21,4 @@
"typescript": "~5.8.2",
"vite": "^6.2.0"
}
-}
+}
\ No newline at end of file