Restructure pipeline

This commit is contained in:
Daniel Kluge 2022-06-23 17:16:20 +02:00
parent cd27815b2e
commit 5099bffff8

View File

@ -11,8 +11,12 @@ steps:
- name: test-build - name: test-build
image: asciidoctor/docker-asciidoctor image: asciidoctor/docker-asciidoctor
commands: commands:
- asciidoctor projects/*.adoc || true - asciidoctor **/*.adoc
- asciidoctor diaries/*.adoc || true - 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 kind: pipeline
type: ssh type: ssh
@ -20,8 +24,6 @@ name: deploy
depends_on: depends_on:
- test - test
trigger: trigger:
branch:
- senpai
event: event:
- push - push
server: server:
@ -32,35 +34,21 @@ server:
ssh_key: ssh_key:
from_secret: ssh_key from_secret: ssh_key
steps: steps:
- name: pull - name: pull-main
when:
branch:
- senpai
commands: commands:
- cd /srv/website/content - cd /srv/website/content
- git config --global --add safe.directory /srv/website/content - git config --global --add safe.directory /srv/website/content
- git switch senpai || true - git switch senpai || true
- git pull - git pull
--- - name: pull-dev
# Push on dev environment when:
kind: pipeline branch:
type: ssh - dev
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
commands: commands:
- cd /srv/website-dev/content - cd /srv/website-dev/content
- git config --global --add safe.directory /srv/website-dev/content - git config --global --add safe.directory /srv/website-dev/content
- git switch dev || true - git switch dev || true
- git pull - git pull