forked from kalamuna/drupal-project
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.yml
72 lines (70 loc) · 2.1 KB
/
config.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
# Kalamuna DrupalProject CircleCI 2.0 configuration file
version: 2
jobs:
build:
docker:
# specify the version you desire here
- image: circleci/php:7.1-node-browsers-legacy
working_directory: ~/drupal
steps:
- checkout
# Restore node modules
- restore_cache:
keys:
- drupal-node-{{ checksum "package-lock.json" }}
- drupal-node-
# Restore composer caches
- restore_cache:
keys:
- drupal-composer-{{ checksum "composer.lock" }}
- drupal-composer-
# Install apt dependencies
- run:
name: apt-get dependencies
command: sudo apt-get update -y && sudo apt-get install -y libpng-dev
# Install PHP Extensions
- run:
name: PHP Extensions
command: sudo docker-php-ext-install gd
# Install composer dependencies
- run: composer install --prefer-dist --no-interaction
# Install node modules and build
- run: npm it
# Cache node_modules
- save_cache:
key: drupal-node-{{ checksum "package-lock.json" }}
paths:
- node_modules
# Cache composer
- save_cache:
key: drupal-composer-{{ checksum "composer.lock" }}
paths:
- ~/.composer/cache
- persist_to_workspace:
root: '~'
paths:
- drupal
deploy:
machine: true
working_directory: ~/drupal
steps:
- attach_workspace:
at: '~'
- run: git config --global user.name "Kala C. Bot"
- run: git config --global user.email "[email protected]"
- run: echo -e "Host *drush.in\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
- run: npm run deploy
workflows:
version: 2
build-and-deploy:
jobs:
- build
- deploy:
requires:
- build
filters:
branches:
# Deploy only when:
# 1. The branch isn't a feature branch (no /).
# 2. The branch name is less then or equal to 11 characters long.
only: /^[^./A-Z]{0,11}$/