frontpage-content/.drone.yml

67 lines
1.2 KiB
YAML

kind: pipeline
type: docker
name: test
trigger:
event:
- push
branch:
- senpai
- dev
steps:
- name: test-build
image: asciidoctor/docker-asciidoctor
commands:
- 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
name: deploy
depends_on:
- test
trigger:
event:
- push
server:
host:
from_secret: ssh_host
user:
from_secret: ssh_user
ssh_key:
from_secret: ssh_key
steps:
- 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
- name: reload-server
when:
branch:
- senpai
commands:
- docker container restart website_server_1
- 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
- name: reload-server-dev
when:
branch:
- dev
commands:
- docker container restart website-dev_server_1