/
.travis.yml
49 lines (46 loc) · 1.64 KB
/
.travis.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
os: linux
language: php
branches:
only:
- master
- trunk
- develop
- /^release\/*/
- /^hotfix\/\d+\.\d+(\.\d+)?(-\S*)?$/
- /^feature\/*/
# Also build tags like 1.1.1 or 1.1 for deployment.
- /^\d+\.\d+(\.\d+)?(-\S*)?$/
jobs:
fast_finish: true
include:
- stage: 🚀 deployment
name: "Deploy to Yoast-dist"
php: 7.2
install:
- yarn global add grunt-cli
- yarn install
before_script: skip
script:
- |
if [[ ! -z "$TRAVIS_TAG" ]]; then
grunt set-version -new-version=$TRAVIS_TAG
grunt update-version
fi
- grunt artifact
if: ( tag IS present OR branch =~ /^feature\// OR branch =~ /^release\// OR branch =~ /^hotfix\// OR branch = trunk OR branch = develop ) AND type != pull_request
before_install:
- nvm install lts/*
- curl -o- -L https://yarnpkg.com/install.sh | bash
- export PATH=$HOME/.yarn/bin:$PATH
- openssl aes-256-cbc -K $encrypted_d1beccaa5494_key -iv $encrypted_d1beccaa5494_iv -in config/travis/deploy_keys/id_rsa_yoast_dist.enc -out config/travis/deploy_keys/id_rsa_yoast_dist -d
- chmod 600 config/travis/deploy_keys/id_rsa_yoast_dist
- eval $(ssh-agent -s)
- ssh-add config/travis/deploy_keys/id_rsa_yoast_dist
# If the commit was tagged, create an artifact and push it to the distribution github
deploy:
skip_cleanup: true
provider: script
script: bash config/travis/deploy_to_dist.sh ${TRAVIS_TAG:-$TRAVIS_BRANCH} duplicate-post
on:
repo: $TRAVIS_REPO_SLUG
all_branches: true