forked from joomla/Manual
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.drone.yml
52 lines (47 loc) · 1.43 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
---
kind: pipeline
name: default
clone:
steps:
- name: build
image: node:18-bullseye-slim
commands:
- npm install
- npm run build
- name: deployment
image: joomlaprojects/docker-images:packager
depends_on:
- build
environment:
REMOTE_PRIVATE_KEY:
from_secret: REMOTE_PRIVATE_KEY
developer_host:
from_secret: developer_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 $developer_host user $sftp_user port 22
- if [ -z "$${DRONE_PULL_REQUEST}" ]; then export TARGET=public_html; else export TARGET=wildcard.manual.joomlacode.org/sites/pr-$${DRONE_PULL_REQUEST}; fi
- rclone -v sync build server:$TARGET
- chmod +x test.sh
- if [ ! -z "$${DRONE_PULL_REQUEST}" ]; then /bin/add_github_status.sh "Preview" "Generated preview for this pull request" "http://pr-$${DRONE_PULL_REQUEST}.manual.joomlacode.org" ; fi;
when:
branch:
main
status:
- success
event:
- push
- pull_request
---
kind: signature
hmac: 3d1303abd175ffda3aec141c6ea71d541f50f3c3e0752a68330fde5560386a58
...