-
Notifications
You must be signed in to change notification settings - Fork 0
/
.drone.yml
105 lines (90 loc) · 1.89 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
kind: pipeline
name: Build and Push
type: docker
platform:
arch: amd64
os: linux
steps:
- name: build from main
image: docker:dind
volumes:
- name: docker_sock
path: /var/run/docker.sock
environment:
github_username:
from_secret: GITHUB_USERNAME
github_token:
from_secret: GITHUB_TOKEN
commands:
- docker compose -f docker-compose.staging.yaml build
- docker login ghcr.io -u $github_username -p $github_token
- docker compose -f docker-compose.staging.yaml push || true
when:
branch:
- dev
event:
- push
volumes:
- name: docker_sock
host:
path: /var/run/docker.sock
---
kind: pipeline
type: ssh
name: Pull image and deploy
server:
host:
from_secret: intellix_hostname
user:
from_secret: intellix_host_user
ssh_key:
from_secret: intellix_ssh_key
steps:
- name: Deploy from main
environment:
github_username:
from_secret: GITHUB_USERNAME
github_token:
from_secret: GITHUB_TOKEN
commands:
- docker login ghcr.io -u $github_username -p $github_token
- docker compose -f docker-compose.staging.yaml pull
- docker compose --project-name rara-rte-staging -f docker-compose.staging.yaml up --no-build --force-recreate -d
- echo Storybook deployed successfully
when:
branch:
- dev
event:
- push
depends_on:
- Build and Push
---
kind: pipeline
name: Build and Push to npm registry
type: docker
platform:
arch: amd64
os: linux
steps:
- name: build from main
image: node:16
environment:
github_username:
from_secret: GITHUB_USERNAME
github_token:
from_secret: GITHUB_TOKEN
npm_token:
from_secret: NPM_TOKEN
commands:
- yarn
- npm config set _authToken=$npm_token
- npm publish --access public
trigger:
branch:
- main
event:
- tag
volumes:
- name: docker_sock
host:
path: /var/run/docker.sock