From 20ac5689a5f28890042c9babfbdd1a590c167e6a Mon Sep 17 00:00:00 2001 From: Joris Slagter Date: Tue, 2 Dec 2025 15:59:23 +0100 Subject: [PATCH] Add Drone CI pipeline configuration --- .drone.yml | 93 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 .drone.yml diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..75e6812 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,93 @@ +kind: pipeline +type: docker +name: default + +steps: + # Step 1: Install dependencies and run linting + - name: test + image: node:20-alpine + commands: + - npm ci + - npm run lint || echo "⚠ Linting skipped (no lint script found)" + - echo "✓ Dependency installation successful" + # Uncomment when tests are ready: + # - npm test + + # Step 2: Build for production (to verify it compiles) + - name: build + image: node:20-alpine + commands: + - npm ci + - npm run build + - echo "✓ Build successful" + + # Step 3: Deploy to staging + - name: deploy-staging + image: appleboy/drone-ssh + when: + branch: + - develop + - main + event: + - push + settings: + host: + from_secret: staging_host + user: root + key: + from_secret: ssh_private_key + port: 22 + script: + - /opt/deploy-scripts/deploy-nuxt.sh staging main + + # Step 4: Deploy to production (manual trigger only) + - name: deploy-production + image: appleboy/drone-ssh + when: + branch: + - main + event: + - promote + target: + - production + settings: + host: + from_secret: production_host + user: root + key: + from_secret: ssh_private_key + port: 22 + script: + - /opt/deploy-scripts/deploy-nuxt.sh production main + + # Step 5: Notification + - name: notify + image: plugins/slack + when: + status: + - success + - failure + settings: + webhook: + from_secret: slack_webhook + channel: deployments + username: Drone CI + template: > + {{#success build.status}} + ✓ Nuxt.js build {{build.number}} succeeded. + Branch: {{build.branch}} + Commit: {{build.commit}} + {{else}} + ✗ Nuxt.js build {{build.number}} failed. + Branch: {{build.branch}} + Commit: {{build.commit}} + {{/success}} + failure: ignore + +trigger: + branch: + - main + - develop + event: + - push + - promote