Fixed error in ci config

This commit is contained in:
pascalyazid committed 2026-05-04 16:31:03 +00:00
1 parent 35a6863745
commit a059045542
1 file changed
+30 -9
+30 -9
View File
@@ -1,23 +1,44 @@
image: oven/bun:alpine
stages: stages:
- build - build
- deploy - deploy
# Your existing Bun build job goes here... cache:
key:
files:
- bun.lock
paths:
- .next/cache/
- node_modules/
build_job: build_job:
stage: build stage: build
# ... (keep your existing build job settings here)
# The new simplified deployment job
deploy_production:
stage: deploy
image: curlimages/curl:latest # A tiny image just to send the webhook
tags: tags:
- nextjs - nextjs
rules: rules:
- if: $CI_COMMIT_BRANCH == "main" - if: $CI_COMMIT_BRANCH == "main"
# This job only runs if the build_job passes successfully - if: $CI_PIPELINE_SOURCE == "merge_request_event"
script:
- echo "Installing dependencies..."
- bun install --frozen-lockfile
- echo "Building the Next.js application..."
- bun run build
artifacts:
paths:
- .next/
- public/
- package.json
expire_in: 1 week
deploy_production:
stage: deploy
image: curlimages/curl:latest
tags:
- nextjs
rules:
- if: $CI_COMMIT_BRANCH == "main"
needs: ["build_job"] needs: ["build_job"]
script: script:
- echo "Triggering Portainer GitOps Webhook..." - echo "Triggering Portainer GitOps Webhook..."
# Replace the URL below with your actual Portainer webhook URL
- curl -X POST "https://portainer.vpn.pascalyazid.com/api/stacks/webhooks/e73812d9-cf5e-4ac4-8648-53f7611b41c8" - curl -X POST "https://portainer.vpn.pascalyazid.com/api/stacks/webhooks/e73812d9-cf5e-4ac4-8648-53f7611b41c8"