forked from enovatedesign/pandemic-pact
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
36 lines (34 loc) · 1.01 KB
/
.gitlab-ci.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
default:
image: gitlab.enovate.co.uk:5050/docker-images/php-ci:php8.0-node${NODE_VERSION}
deploy_review:
stage: deploy
except:
- develop
- master
script:
- npm install --global vercel
- vercel pull --yes --environment=preview --token=$VERCEL_TOKEN
- vercel deploy --build-env "SEARCH_INDEX_PREFIX=$CI_COMMIT_REF_NAME" --token=$VERCEL_TOKEN | sed -e 's/^/DYNAMIC_ENVIRONMENT_URL=/' > deploy.env
artifacts:
reports:
dotenv: deploy.env
environment:
name: review/$CI_COMMIT_REF_NAME
url: $DYNAMIC_ENVIRONMENT_URL
on_stop: stop_review
stop_review:
stage: deploy
except:
- develop
- master
script:
- |
curl -X DELETE \
-u "${SEARCH_USERNAME}:${SEARCH_PASSWORD}" \
"${SEARCH_HOST}/${CI_COMMIT_REF_NAME}-grants"
environment:
name: review/$CI_COMMIT_REF_NAME
action: stop
when: manual
variables:
GIT_STRATEGY: none