Blog/.drone.yml

125 lines
2.1 KiB
YAML
Raw Normal View History

2021-12-23 14:26:58 +01:00
---
kind: pipeline
type: docker
name: "Test Pipeline"
trigger:
event:
exclude:
- tag
steps:
2021-12-23 14:34:14 +01:00
- name: submodules
image: alpine/git
commands:
- git submodule update --init --recursive
2021-12-23 14:26:58 +01:00
- name: "Hugo test build"
2021-12-30 21:02:18 +01:00
image: node:lts-buster-slim
2021-12-23 14:26:58 +01:00
commands:
2021-12-30 21:02:18 +01:00
- npm install
- npm run test
- npm run build
2021-12-23 14:26:58 +01:00
---
kind: pipeline
type: docker
name: "Next Build Pipeline"
trigger:
event:
exclude:
- pull_request
branch:
exclude:
- master
depends_on:
- "Test Pipeline"
steps:
2021-12-23 14:34:14 +01:00
- name: submodules
image: alpine/git
commands:
- git submodule update --init --recursive
2021-12-23 14:26:58 +01:00
- name: "Build (${DRONE_BRANCH} as next)"
image: plugins/docker
settings:
username:
from_secret: hub_user
password:
from_secret: hub_passwd
repo: ocram85/blog
tags: "next"
dockerfile: Dockerfile
- name: "Trivy (next)"
image: aquasec/trivy
commands:
2022-01-03 09:11:38 +01:00
- "trivy image --exit-code 1 --no-progress ocram85/blog:next"
2021-12-23 14:26:58 +01:00
---
kind: pipeline
type: docker
name: "Master Build Pipeline"
trigger:
event:
exclude:
- pull_request
- tag
branch:
include:
- master
depends_on:
- "Test Pipeline"
steps:
2021-12-23 14:34:14 +01:00
- name: submodules
image: alpine/git
commands:
- git submodule update --init --recursive
2021-12-23 14:26:58 +01:00
- name: "Build (master)"
image: plugins/docker
settings:
username:
from_secret: hub_user
password:
from_secret: hub_passwd
repo: ocram85/blog
auto_tag: true
dockerfile: Dockerfile
- name: "Trivy (latest)"
image: aquasec/trivy
commands:
- "trivy image ocram85/blog:latest"
---
kind: pipeline
type: docker
name: "Tags Pipeline"
trigger:
event:
include:
- tag
steps:
2021-12-23 14:34:14 +01:00
- name: submodules
image: alpine/git
commands:
- git submodule update --init --recursive
2021-12-23 14:26:58 +01:00
- name: "Build tag image"
image: plugins/docker
settings:
username:
from_secret: hub_user
password:
from_secret: hub_passwd
repo: ocram85/blog
auto_tag: true