From 5099bffff89575804da844c378d5e52e73295afa Mon Sep 17 00:00:00 2001 From: Daniel Kluge Date: Thu, 23 Jun 2022 17:16:20 +0200 Subject: [PATCH] Restructure pipeline --- .drone.yml | 42 +++++++++++++++--------------------------- 1 file changed, 15 insertions(+), 27 deletions(-) diff --git a/.drone.yml b/.drone.yml index 469f230..7903819 100644 --- a/.drone.yml +++ b/.drone.yml @@ -11,8 +11,12 @@ steps: - name: test-build image: asciidoctor/docker-asciidoctor commands: - - asciidoctor projects/*.adoc || true - - asciidoctor diaries/*.adoc || true + - asciidoctor **/*.adoc +- name: verify-json + image: node:lts-alpine + commands: + - npm install -g ajv-cli ajv-formats + - ajv validate --spec=draft2020 -s ./list.schema.json -d ./list.json -c ajv-formats --- kind: pipeline type: ssh @@ -20,8 +24,6 @@ name: deploy depends_on: - test trigger: - branch: - - senpai event: - push server: @@ -32,35 +34,21 @@ server: ssh_key: from_secret: ssh_key steps: -- name: pull +- name: pull-main + when: + branch: + - senpai commands: - cd /srv/website/content - git config --global --add safe.directory /srv/website/content - git switch senpai || true - git pull ---- -# Push on dev environment -kind: pipeline -type: ssh -name: deploy-dev -depends_on: -- test -trigger: - branch: - - dev - event: - - push -server: - host: - from_secret: ssh_host - user: - from_secret: ssh_user - ssh_key: - from_secret: ssh_key -steps: -- name: pull +- name: pull-dev + when: + branch: + - dev commands: - cd /srv/website-dev/content - git config --global --add safe.directory /srv/website-dev/content - git switch dev || true - - git pull \ No newline at end of file + - git pull