-
Notifications
You must be signed in to change notification settings - Fork 0
/
.drone.yml
73 lines (66 loc) · 1.96 KB
/
.drone.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
kind: pipeline
type: docker
name: test
steps:
- name: Test Node
image: satantime/puppeteer-node:23-bookworm-slim
commands:
- apt-get update && apt-get install -y xz-utils # Remove when https://github.com/satanTime/puppeteer-node/issues/26 is resolved
- ln -fs .env.development .env
- apt-get update && apt-get install -y curl git
- npm ci
- npm run test-node
- name: Test Bash
image: koalaman/shellcheck-alpine:stable
commands:
- ln -fs .env.development .env
- shellcheck -x bin/*.sh
- name: Test Dockerfile
image: hadolint/hadolint:latest-alpine
commands:
- hadolint Dockerfile --ignore=DL3008 --ignore=SC2046 --ignore=SC2006
- name: Test Nginx
image: albertyw/gixy:0.2.2
commands:
- gixy config/nginx/*
- name: Build Docker Container
depends_on:
- Test Node
- Test Bash
- Test Dockerfile
- Test Nginx
image: plugins/docker
settings:
repo: codemancer
tags: test
dry_run: true
- name: Deploy
depends_on:
- Build Docker Container
environment:
SSH_KEY:
from_secret: ssh_key
image: albertyw/ssh-client:4.1.7
commands:
- ssh-keyscan direct.albertyw.com >> /root/.ssh/known_hosts
- echo "$${SSH_KEY}" > /root/.ssh/id_ed25519
- chmod 600 /root/.ssh/id_ed25519
- ssh albertyw@direct.albertyw.com codemancer/bin/deploy.sh master
when:
branch:
- master
- name: Purge Cache
depends_on:
- Deploy
image: curlimages/curl:8.11.1
commands:
- |-
curl -X DELETE "https://api.cloudflare.com/client/v4/zones/$${CLOUDFLARE_ZONE_ID}/purge_cache" -H "Authorization: Bearer $${CLOUDFLARE_API_KEY}" -H "Content-Type: application/json" --data '{"purge_everything":true}'
when:
branch:
- master
environment:
CLOUDFLARE_ZONE_ID:
from_secret: CLOUDFLARE_ZONE_ID
CLOUDFLARE_API_KEY:
from_secret: CLOUDFLARE_API_KEY