Repository navigation
Expand file tree
/
Copy path.gitlab-ci.example.yml
More file actions
78 lines (70 loc) · 1.57 KB
/
Copy path.gitlab-ci.example.yml
File metadata and controls
78 lines (70 loc) · 1.57 KB
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
stages:
- composer
- assets
- deploy
variables:
PLUGIN_SLUG: wpify-plugin-skeleton
cache:
paths:
- build/
- deps/
- vendor/
composer:
stage: composer
image: composer:2.1.11
before_script:
- PATH=$(composer global config bin-dir --absolute --quiet):$PATH
- composer config -g cache-dir "$(pwd)/.composer-cache"
- composer global require wpify/scoper
script:
- composer install --no-dev --prefer-dist --optimize-autoloader --ignore-platform-reqs
only:
- tags
assets:
stage: assets
image: node:14
script:
- npm install
- NODE_ENV=production npm run build
only:
- tags
.deploy_template_wporg: &deploy_definition_wporg
stage: deploy
image: alpine:latest
before_script:
- apk update
- apk add subversion bash
script:
- ./bin/ci-deploy-wporg
only:
- tags
.deploy_template_server: &deploy_definition_server
stage: deploy
image: alpine:latest
before_script:
- apk update
- apk add openssh-client bash rsync
- eval $(ssh-agent -s)
- echo "$PRIVATE_KEY" | tr -d '\r' | ssh-add -
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- ssh-keyscan -t rsa "$SERVER_ADDR" >> ~/.ssh/known_hosts
script:
- ./bin/create-dist
- ./bin/ci-deploy-server
deploy_production:
<<: *deploy_definition_wporg
environment:
name: production
url: https://www.wpify.io
only:
- tags
deploy_staging:
<<: *deploy_definition_server
variables:
SERVER_PATH: $SERVER_PATH/$WPIFY_PLUGIN_SKELETON_URL
environment:
name: staging
url: https://staging.wpify.io
only:
- master