merge: integrate master deployment changes (keep BuildKit setup)
This commit is contained in:
60
.gitea/workflows/build.yaml
Normal file
60
.gitea/workflows/build.yaml
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
name: Build and Push to GHCR
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [master, main]
|
||||||
|
|
||||||
|
env:
|
||||||
|
REGISTRY: ghcr.io
|
||||||
|
IMAGE_NAME: ${{ github.repository }}
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
|
- name: Log in to Container Registry
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: ${{ env.REGISTRY }}
|
||||||
|
username: ${{ github.actor }}
|
||||||
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Extract metadata
|
||||||
|
id: meta
|
||||||
|
uses: docker/metadata-action@v5
|
||||||
|
with:
|
||||||
|
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||||
|
tags: |
|
||||||
|
type=sha,prefix=,suffix=,format=short
|
||||||
|
type=raw,value=latest,enable={{is_default_branch}}
|
||||||
|
|
||||||
|
- name: Build and push Docker image
|
||||||
|
uses: docker/build-push-action@v5
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
push: true
|
||||||
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
|
cache-from: type=gha
|
||||||
|
cache-to: type=gha,mode=max
|
||||||
|
|
||||||
|
- name: Update kustomization.yaml
|
||||||
|
run: |
|
||||||
|
COMMIT_SHA=${{ github.sha }}
|
||||||
|
SHORT_SHA=${COMMIT_SHA:0:7}
|
||||||
|
sed -i "s|newTag: .*|newTag: ${SHORT_SHA}|" k8s/kustomization.yaml
|
||||||
|
|
||||||
|
- name: Commit and push changes
|
||||||
|
run: |
|
||||||
|
git config --local user.email "gitea-actions[bot]@users.noreply.gitea.io"
|
||||||
|
git config --local user.name "gitea-actions[bot]"
|
||||||
|
git add k8s/kustomization.yaml
|
||||||
|
git diff --quiet && git diff --staged --quiet || git commit -m "deploy: update image to ${SHORT_SHA} [skip ci]"
|
||||||
|
git push
|
||||||
@@ -39,3 +39,4 @@ Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/bui
|
|||||||
// Auto-deploy test: 2026-03-07T09:02:49Z
|
// Auto-deploy test: 2026-03-07T09:02:49Z
|
||||||
// Auto-deploy test: 2026-03-07T10:33:23Z
|
// Auto-deploy test: 2026-03-07T10:33:23Z
|
||||||
// Auto-deploy test 2: 2026-03-07T10:37:05Z
|
// Auto-deploy test 2: 2026-03-07T10:37:05Z
|
||||||
|
# Trigger build Sun Apr 5 06:32:05 AM EET 2026
|
||||||
|
|||||||
@@ -13,112 +13,16 @@ spec:
|
|||||||
labels:
|
labels:
|
||||||
app: storefront
|
app: storefront
|
||||||
spec:
|
spec:
|
||||||
initContainers:
|
imagePullSecrets:
|
||||||
- name: clone
|
- name: ghcr-pull-secret
|
||||||
image: alpine/git:latest
|
|
||||||
command:
|
|
||||||
- sh
|
|
||||||
- -c
|
|
||||||
- |
|
|
||||||
set -e
|
|
||||||
apk add --no-cache git
|
|
||||||
# Clean workspace if it exists (handles pod restarts)
|
|
||||||
if [ -d /workspace/.git ]; then
|
|
||||||
echo "Workspace exists, pulling latest changes..."
|
|
||||||
cd /workspace
|
|
||||||
git fetch origin master
|
|
||||||
git reset --hard origin/master
|
|
||||||
else
|
|
||||||
echo "Cloning fresh repository..."
|
|
||||||
rm -rf /workspace/*
|
|
||||||
git clone --depth 1 --branch master \
|
|
||||||
http://gitea.gitea.svc.cluster.local:3000/unchained/manoon-headless.git \
|
|
||||||
/workspace
|
|
||||||
fi
|
|
||||||
echo "Clone/update complete."
|
|
||||||
volumeMounts:
|
|
||||||
- name: workspace
|
|
||||||
mountPath: /workspace
|
|
||||||
securityContext:
|
|
||||||
runAsUser: 0
|
|
||||||
resources:
|
|
||||||
limits:
|
|
||||||
cpu: 500m
|
|
||||||
memory: 256Mi
|
|
||||||
- name: install
|
|
||||||
image: node:20-slim
|
|
||||||
workingDir: /workspace
|
|
||||||
command:
|
|
||||||
- sh
|
|
||||||
- -c
|
|
||||||
- |
|
|
||||||
set -e
|
|
||||||
echo "Installing dependencies..."
|
|
||||||
npm install --prefer-offline --no-audit 2>&1
|
|
||||||
echo "Dependencies installed."
|
|
||||||
volumeMounts:
|
|
||||||
- name: workspace
|
|
||||||
mountPath: /workspace
|
|
||||||
securityContext:
|
|
||||||
runAsUser: 0
|
|
||||||
resources:
|
|
||||||
limits:
|
|
||||||
cpu: 2000m
|
|
||||||
memory: 3Gi
|
|
||||||
requests:
|
|
||||||
cpu: 100m
|
|
||||||
memory: 1Gi
|
|
||||||
- name: build
|
|
||||||
image: node:20-slim
|
|
||||||
workingDir: /workspace
|
|
||||||
command:
|
|
||||||
- sh
|
|
||||||
- -c
|
|
||||||
- |
|
|
||||||
set -e
|
|
||||||
echo "Building Next.js app..."
|
|
||||||
npm run build
|
|
||||||
echo "Build complete!"
|
|
||||||
env:
|
|
||||||
- name: NODE_ENV
|
|
||||||
value: "production"
|
|
||||||
- name: NEXT_PUBLIC_SALEOR_API_URL
|
|
||||||
value: "https://api.manoonoils.com/graphql/"
|
|
||||||
- name: NEXT_PUBLIC_SITE_URL
|
|
||||||
value: "https://manoonoils.com"
|
|
||||||
- name: DASHBOARD_URL
|
|
||||||
value: "https://dashboard.manoonoils.com"
|
|
||||||
- name: NEXT_PUBLIC_OPENPANEL_CLIENT_ID
|
|
||||||
value: "fa61f8ae-0b5d-4187-a9b1-5a04b0025674"
|
|
||||||
- name: OPENPANEL_CLIENT_SECRET
|
|
||||||
value: "91126be0d1e78e657e0427df82733832.c6d30edf6ee673da9650a883604169a13ab8579a0dde70cb39b477f4cf441f90"
|
|
||||||
- name: OPENPANEL_API_URL
|
|
||||||
value: "https://op.nodecrew.me/api"
|
|
||||||
- name: MAUTIC_CLIENT_ID
|
|
||||||
value: "2_23cgmaqef8kgg8oo4kggc0w4wccwoss8o8w48o8sc40cowgkkg"
|
|
||||||
- name: MAUTIC_CLIENT_SECRET
|
|
||||||
value: "4k8367ab306co48c4c8g8sco8cgcwwww044gwccs0o0c8w4gco"
|
|
||||||
- name: MAUTIC_API_URL
|
|
||||||
value: "https://mautic.nodecrew.me"
|
|
||||||
volumeMounts:
|
|
||||||
- name: workspace
|
|
||||||
mountPath: /workspace
|
|
||||||
securityContext:
|
|
||||||
runAsUser: 0
|
|
||||||
resources:
|
|
||||||
limits:
|
|
||||||
cpu: 2000m
|
|
||||||
memory: 2Gi
|
|
||||||
requests:
|
|
||||||
cpu: 100m
|
|
||||||
memory: 512Mi
|
|
||||||
containers:
|
containers:
|
||||||
- name: storefront
|
- name: storefront
|
||||||
image: node:20-slim
|
image: ghcr.io/unchainedio/manoon-headless:latest # {"": "flux-system:manoon-headless"}
|
||||||
workingDir: /workspace
|
imagePullPolicy: Always
|
||||||
command:
|
command:
|
||||||
- npm
|
- node
|
||||||
- start
|
- server.js
|
||||||
|
workingDir: /app
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 3000
|
- containerPort: 3000
|
||||||
env:
|
env:
|
||||||
@@ -179,10 +83,3 @@ spec:
|
|||||||
port: 3000
|
port: 3000
|
||||||
periodSeconds: 5
|
periodSeconds: 5
|
||||||
failureThreshold: 3
|
failureThreshold: 3
|
||||||
volumeMounts:
|
|
||||||
- name: workspace
|
|
||||||
mountPath: /workspace
|
|
||||||
volumes:
|
|
||||||
- name: workspace
|
|
||||||
emptyDir:
|
|
||||||
sizeLimit: 2Gi
|
|
||||||
|
|||||||
@@ -5,6 +5,3 @@ resources:
|
|||||||
- service.yaml
|
- service.yaml
|
||||||
- middleware.yaml
|
- middleware.yaml
|
||||||
- ingress.yaml
|
- ingress.yaml
|
||||||
images:
|
|
||||||
- name: ghcr.io/unchainedio/manoon-headless
|
|
||||||
newTag: 2c27fc6 # Updated by GitHub Actions
|
|
||||||
|
|||||||
Reference in New Issue
Block a user