-
Notifications
You must be signed in to change notification settings - Fork 12
/
.drone.yml
71 lines (66 loc) · 1.9 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
---
kind: pipeline
name: default
clone:
steps:
- name: build
image: node:18-bullseye-slim
environment:
CROWDIN_PERSONAL_TOKEN:
from_secret: CROWDIN_PERSONAL_TOKEN
commands:
- npm install
- npm run write-translations
- npm run build
- name: translations
image: node:18-bullseye-slim
depends_on:
- build
environment:
CROWDIN_PERSONAL_TOKEN:
from_secret: CROWDIN_PERSONAL_TOKEN
commands:
- bash bin/crowdin_upload_prepare.sh
- npm run crowdin upload
- npm run crowdin download
when:
branch: main
status:
- success
event:
- push
- name: deployment
image: joomlaprojects/docker-images:packager
depends_on:
- build
- translations
environment:
REMOTE_PRIVATE_KEY:
from_secret: REMOTE_PRIVATE_KEY
DEPLOY_HOST:
from_secret: DEPLOY_HOST
SFTP_USER:
from_secret: SFTP_USER
GITHUB_TOKEN:
from_secret: GITHUB_TOKEN
commands:
- mkdir -p ~/.ssh
- eval $(ssh-agent -s)
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
- echo "$REMOTE_PRIVATE_KEY" > ~/.ssh/id_rsa
- chmod 600 ~/.ssh/id_rsa
- ssh-add
- rclone config create server sftp host $DEPLOY_HOST user $SFTP_USER port 22
- if [ -z "$${DRONE_PULL_REQUEST}" ]; then export TARGET=public_html; else export TARGET=wildcard.docs.joomlacode.org/sites/pr-$${DRONE_PULL_REQUEST}; fi
- rclone -v sync build server:$TARGET
- if [ ! -z "$${DRONE_PULL_REQUEST}" ]; then /bin/add_github_status.sh "Preview" "Generated preview for this pull request" "http://pr-$${DRONE_PULL_REQUEST}.docs.joomlacode.org" ; fi;
when:
branch: main
status:
- success
event:
- push
- pull_request
---
kind: signature
hmac: 2dbfe5f02c36556ba32c6509abac1ad4166b01ba286aa19eb623ec7b090cabd8