Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| bbcc7d159c | |||
| 39f5bd3986 | |||
| 944d369d43 | |||
| 6aaf8ac44f |
@@ -316,6 +316,7 @@ jobs:
|
|||||||
S3_BUCKET=${{ secrets.S3_BUCKET || vars.S3_BUCKET || 'mintel' }}
|
S3_BUCKET=${{ secrets.S3_BUCKET || vars.S3_BUCKET || 'mintel' }}
|
||||||
S3_REGION=${{ secrets.S3_REGION || vars.S3_REGION || 'fsn1' }}
|
S3_REGION=${{ secrets.S3_REGION || vars.S3_REGION || 'fsn1' }}
|
||||||
S3_PREFIX=${{ secrets.S3_PREFIX || vars.S3_PREFIX || 'mintel.me' }}
|
S3_PREFIX=${{ secrets.S3_PREFIX || vars.S3_PREFIX || 'mintel.me' }}
|
||||||
|
BUILD_ID=${{ github.sha }}
|
||||||
tags: registry.infra.mintel.me/mintel/mintel.me:${{ needs.prepare.outputs.image_tag }}
|
tags: registry.infra.mintel.me/mintel/mintel.me:${{ needs.prepare.outputs.image_tag }}
|
||||||
cache-from: type=registry,ref=registry.infra.mintel.me/mintel/mintel.me:buildcache-${{ needs.prepare.outputs.target }}
|
cache-from: type=registry,ref=registry.infra.mintel.me/mintel/mintel.me:buildcache-${{ needs.prepare.outputs.target }}
|
||||||
cache-to: type=registry,ref=registry.infra.mintel.me/mintel/mintel.me:buildcache-${{ needs.prepare.outputs.target }},mode=max
|
cache-to: type=registry,ref=registry.infra.mintel.me/mintel/mintel.me:buildcache-${{ needs.prepare.outputs.target }},mode=max
|
||||||
@@ -532,6 +533,29 @@ jobs:
|
|||||||
docker compose -p '${{ needs.prepare.outputs.project_name }}' --env-file $ENV_FILE up -d --remove-orphans
|
docker compose -p '${{ needs.prepare.outputs.project_name }}' --env-file $ENV_FILE up -d --remove-orphans
|
||||||
"
|
"
|
||||||
|
|
||||||
|
- name: 🧹 Purge S3 Cache
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
echo "Installing rclone..."
|
||||||
|
curl -s -O https://downloads.rclone.org/rclone-current-linux-amd64.deb
|
||||||
|
sudo dpkg -i rclone-current-linux-amd64.deb > /dev/null 2>&1
|
||||||
|
|
||||||
|
echo "Configuring rclone..."
|
||||||
|
cat > rclone.conf <<EOF
|
||||||
|
[mintel-s3]
|
||||||
|
type = s3
|
||||||
|
provider = Other
|
||||||
|
access_key_id = ${{ secrets.S3_ACCESS_KEY || vars.S3_ACCESS_KEY }}
|
||||||
|
secret_access_key = ${{ secrets.S3_SECRET_KEY || vars.S3_SECRET_KEY }}
|
||||||
|
endpoint = ${{ secrets.S3_ENDPOINT || vars.S3_ENDPOINT || 'https://fsn1.your-objectstorage.com' }}
|
||||||
|
region = ${{ secrets.S3_REGION || vars.S3_REGION || 'fsn1' }}
|
||||||
|
EOF
|
||||||
|
|
||||||
|
echo "Purging S3 cache for ${{ env.S3_PREFIX }} ..."
|
||||||
|
rclone --config rclone.conf delete mintel-s3:${{ env.S3_BUCKET }}/${{ env.S3_PREFIX }}/cache/ --include "*" || true
|
||||||
|
|
||||||
|
rm rclone.conf rclone-current-linux-amd64.deb
|
||||||
|
|
||||||
- name: 🧹 Post-Deploy Cleanup (Runner)
|
- name: 🧹 Post-Deploy Cleanup (Runner)
|
||||||
if: always()
|
if: always()
|
||||||
run: docker builder prune -f --filter "until=1h"
|
run: docker builder prune -f --filter "until=1h"
|
||||||
|
|||||||
12
Dockerfile
12
Dockerfile
@@ -13,6 +13,7 @@ ARG S3_SECRET_KEY
|
|||||||
ARG S3_BUCKET
|
ARG S3_BUCKET
|
||||||
ARG S3_REGION
|
ARG S3_REGION
|
||||||
ARG S3_PREFIX
|
ARG S3_PREFIX
|
||||||
|
ARG BUILD_ID
|
||||||
|
|
||||||
# Environment variables for Next.js build
|
# Environment variables for Next.js build
|
||||||
ENV NEXT_PUBLIC_BASE_URL=$NEXT_PUBLIC_BASE_URL
|
ENV NEXT_PUBLIC_BASE_URL=$NEXT_PUBLIC_BASE_URL
|
||||||
@@ -47,6 +48,10 @@ RUN --mount=type=cache,id=pnpm,target=/pnpm/store \
|
|||||||
rm .npmrc
|
rm .npmrc
|
||||||
|
|
||||||
# Copy source code
|
# Copy source code
|
||||||
|
# We use BUILD_ID here to ensure that if the commit changes, we always COPY the latest files
|
||||||
|
# even if Docker's metadata-based fingerprinting for the public directory fails.
|
||||||
|
ARG BUILD_ID
|
||||||
|
RUN echo "Building with ID: ${BUILD_ID}"
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
# Build application (monorepo filter)
|
# Build application (monorepo filter)
|
||||||
@@ -65,6 +70,13 @@ COPY --from=builder /app/apps/web/.next/static ./apps/web/.next/static
|
|||||||
|
|
||||||
# Explicitly copy Payload dynamically generated importMap.js excluded by Standalone tracing
|
# Explicitly copy Payload dynamically generated importMap.js excluded by Standalone tracing
|
||||||
COPY --from=builder /app/apps/web/app/(payload)/admin/importMap.js ./apps/web/app/(payload)/admin/importMap.js
|
COPY --from=builder /app/apps/web/app/(payload)/admin/importMap.js ./apps/web/app/(payload)/admin/importMap.js
|
||||||
|
|
||||||
|
# Fix permissions for the non-root user (Standard uid/gid from base image)
|
||||||
|
# We do this as root before switching users
|
||||||
|
USER root
|
||||||
|
RUN chown -R 1001:65533 /app
|
||||||
|
USER nextjs
|
||||||
|
|
||||||
# Start from the app directory to ensure references solve correctly
|
# Start from the app directory to ensure references solve correctly
|
||||||
WORKDIR /app/apps/web
|
WORKDIR /app/apps/web
|
||||||
CMD ["node", "server.js"]
|
CMD ["node", "server.js"]
|
||||||
|
|||||||
@@ -2,6 +2,8 @@ import { getAllPosts } from "@/src/lib/posts";
|
|||||||
import { BlogClient } from "@/src/components/blog/BlogClient";
|
import { BlogClient } from "@/src/components/blog/BlogClient";
|
||||||
import type { Metadata } from "next";
|
import type { Metadata } from "next";
|
||||||
|
|
||||||
|
export const dynamic = "force-dynamic";
|
||||||
|
|
||||||
export const metadata: Metadata = {
|
export const metadata: Metadata = {
|
||||||
title: "Blog | Mintel.me",
|
title: "Blog | Mintel.me",
|
||||||
description:
|
description:
|
||||||
|
|||||||
@@ -287,6 +287,9 @@ export interface Inquiry {
|
|||||||
email: string;
|
email: string;
|
||||||
companyName?: string | null;
|
companyName?: string | null;
|
||||||
projectType?: string | null;
|
projectType?: string | null;
|
||||||
|
phone?: string | null;
|
||||||
|
role?: string | null;
|
||||||
|
deadline?: string | null;
|
||||||
message?: string | null;
|
message?: string | null;
|
||||||
isFreeText?: boolean | null;
|
isFreeText?: boolean | null;
|
||||||
/**
|
/**
|
||||||
@@ -808,7 +811,10 @@ export interface InquiriesSelect<T extends boolean = true> {
|
|||||||
name?: T;
|
name?: T;
|
||||||
email?: T;
|
email?: T;
|
||||||
companyName?: T;
|
companyName?: T;
|
||||||
|
phone?: T;
|
||||||
|
role?: T;
|
||||||
projectType?: T;
|
projectType?: T;
|
||||||
|
deadline?: T;
|
||||||
message?: T;
|
message?: T;
|
||||||
isFreeText?: T;
|
isFreeText?: T;
|
||||||
config?: T;
|
config?: T;
|
||||||
|
|||||||
Reference in New Issue
Block a user