frontpage-content/.drone.yml

67 lines
1.2 KiB
YAML
Raw Normal View History

2022-01-14 17:11:38 +01:00
kind: pipeline
type: docker
2022-02-06 14:51:22 +01:00
name: test
2022-01-14 17:11:38 +01:00
trigger:
event:
- push
branch:
- senpai
2022-06-12 15:28:01 +02:00
- dev
2022-01-14 17:11:38 +01:00
steps:
- name: test-build
image: asciidoctor/docker-asciidoctor
commands:
2022-06-23 17:16:20 +02:00
- 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
2022-02-06 14:51:22 +01:00
---
kind: pipeline
type: ssh
name: deploy
depends_on:
- test
trigger:
event:
- push
server:
host:
2022-02-06 14:53:01 +01:00
from_secret: ssh_host
2022-02-06 14:51:22 +01:00
user:
2022-02-06 14:53:01 +01:00
from_secret: ssh_user
2022-02-06 14:51:22 +01:00
ssh_key:
from_secret: ssh_key
steps:
2022-06-23 17:16:20 +02:00
- name: pull-main
when:
branch:
- senpai
2022-06-12 15:28:01 +02:00
commands:
2022-06-12 15:37:00 +02:00
- cd /srv/website/content
- git config --global --add safe.directory /srv/website/content
- git switch senpai || true
2022-06-12 15:28:01 +02:00
- git pull
2022-07-30 18:02:05 +02:00
- name: reload-server
when:
branch:
- senpai
commands:
2022-07-30 18:03:03 +02:00
- docker container restart website_server_1 || true
2022-06-23 17:16:20 +02:00
- name: pull-dev
when:
branch:
- dev
2022-02-06 14:51:22 +01:00
commands:
2022-06-12 15:33:48 +02:00
- cd /srv/website-dev/content
2022-06-12 15:37:00 +02:00
- git config --global --add safe.directory /srv/website-dev/content
- git switch dev || true
2022-06-23 17:16:20 +02:00
- git pull
2022-07-30 18:02:05 +02:00
- name: reload-server-dev
when:
branch:
- dev
commands:
2022-07-30 18:03:03 +02:00
- docker container restart website-dev_server_1 || true