www/.drone.yml

55 lines
1.1 KiB
YAML
Raw Normal View History

2022-11-29 05:37:37 +00:00
---
kind: pipeline
type: kubernetes
name: default
2022-11-29 06:17:50 +00:00
metadata:
labels:
pod-security.kubernetes.io/audit: privileged
services:
- name: docker daemon
image: docker:dind
2022-11-29 06:50:43 +00:00
privileged: true
2022-11-29 07:01:27 +00:00
environment:
DOCKER_TLS_CERTDIR: ""
when:
event:
- tag
- promote
2022-11-29 05:37:37 +00:00
steps:
2022-11-29 05:53:38 +00:00
- name: node.js build
2022-11-29 05:37:37 +00:00
image: node:18
commands:
2022-11-29 05:48:00 +00:00
- "npm add --global pnpm"
- pnpm i --no-frozen-lockfile
2022-11-29 05:37:37 +00:00
- pnpm run build
2022-11-29 05:53:38 +00:00
2022-11-29 06:01:20 +00:00
- name: container build
image: docker:latest
2022-11-29 06:50:43 +00:00
privileged: true
2022-11-29 05:53:38 +00:00
commands:
- "while ! docker stats --no-stream; do sleep 1; done"
- "docker build -t $DOCKER_REGISTRY/garrettmills/www ."
- "docker push $DOCKER_REGISTRY/garrettmills/www"
2022-11-29 05:53:38 +00:00
environment:
2022-11-29 07:02:20 +00:00
DOCKER_HOST: tcp://localhost:2375
2022-11-29 05:53:38 +00:00
DOCKER_REGISTRY:
from_secret: DOCKER_REGISTRY
when:
event:
- tag
- promote
2022-11-29 07:09:46 +00:00
- name: k8s rollout
image: bitnami/kubectl
2022-11-29 07:12:20 +00:00
privileged: true
2022-11-29 07:09:46 +00:00
commands:
- cd deploy && kubectl apply -f .
2022-11-29 08:29:03 +00:00
- kubectl rollout restart deployment/garrettmills-dev -n default
when:
event:
- tag
- promote