All checks were successful
Build & Deploy Landing / build-and-deploy (push) Successful in 1m0s
Setup PostHog côté landing — loader inline dans Layout.astro + tracking de 5 events business côté browser : - blog_article_viewed / blog_cta_clicked (funnel blog → app) - pricing_pro_cta_clicked / pricing_plan_selected (intent upgrade) - signup_cta_clicked (CTA hero/header/finalCTA, location-aware) Vars PUBLIC_POSTHOG_* inlinées au build via build-arg CI (POSTHOG_PROJECT_TOKEN, partagé avec apps/web). Token public phc_*, safe à bake dans le bundle. Au passage : supprime posthog-server.ts laissé par le wizard (dead code, importait posthog-node qui n'est pas dans les deps). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
79 lines
2.5 KiB
YAML
79 lines
2.5 KiB
YAML
name: Build & Deploy Landing
|
|
|
|
# Workflow pour la landing Astro (rubis.pro). Migration depuis l'ancienne
|
|
# landing nginx statique : rendu SSR par Node 22 (Astro adapter standalone),
|
|
# pages statiques prerenderées + blog en SSR pur fetch via apps/api.
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
paths:
|
|
- 'apps/landing/**'
|
|
- 'packages/ui/**'
|
|
- 'packages/shared/**'
|
|
- 'Dockerfile.landing'
|
|
- 'k3s/namespace.yml'
|
|
- 'k3s/app/landing.yml'
|
|
- '.gitea/workflows/deploy-landing.yml'
|
|
- 'pnpm-lock.yaml'
|
|
|
|
env:
|
|
REGISTRY: git.arthurbarre.fr
|
|
IMAGE: ordinarthur/rubis-landing
|
|
NAMESPACE: rubis
|
|
|
|
jobs:
|
|
build-and-deploy:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Login to Gitea Registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ${{ env.REGISTRY }}
|
|
username: ordinarthur
|
|
password: ${{ secrets.REGISTRY_PASSWORD }}
|
|
|
|
- name: Build and push image
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: .
|
|
file: Dockerfile.landing
|
|
push: true
|
|
tags: |
|
|
${{ env.REGISTRY }}/${{ env.IMAGE }}:latest
|
|
${{ env.REGISTRY }}/${{ env.IMAGE }}:${{ github.sha }}
|
|
# PostHog — token public inliné dans le bundle client Astro à la
|
|
# compile. Le secret est partagé avec apps/web (même projet PostHog).
|
|
build-args: |
|
|
PUBLIC_POSTHOG_PROJECT_TOKEN=${{ secrets.POSTHOG_PROJECT_TOKEN }}
|
|
PUBLIC_POSTHOG_HOST=https://eu.i.posthog.com
|
|
|
|
- name: Install kubectl
|
|
run: |
|
|
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
|
|
chmod +x kubectl
|
|
mv kubectl /usr/local/bin/
|
|
|
|
- name: Deploy to K3s
|
|
run: |
|
|
mkdir -p ~/.kube
|
|
echo "${{ secrets.KUBECONFIG }}" | base64 -d > ~/.kube/config
|
|
chmod 600 ~/.kube/config
|
|
|
|
kubectl apply -f k3s/namespace.yml
|
|
|
|
kubectl -n $NAMESPACE create secret docker-registry gitea-registry \
|
|
--docker-server=$REGISTRY \
|
|
--docker-username=ordinarthur \
|
|
--docker-password=${{ secrets.REGISTRY_PASSWORD }} \
|
|
--dry-run=client -o yaml | kubectl apply -f -
|
|
|
|
kubectl apply -f k3s/app/landing.yml
|
|
|
|
kubectl -n $NAMESPACE set image deployment/rubis-landing \
|
|
landing=$REGISTRY/$IMAGE:${{ github.sha }}
|
|
|
|
kubectl -n $NAMESPACE rollout status deployment/rubis-landing --timeout=180s
|