-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
32 lines (29 loc) · 1.06 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
image: node:12.18.3
cache:
paths:
- node_modules/
# created for initial tests; not used
# deploy:
# stage: deploy
# before_script:
# - npm install netlify-cli -g
# - npm install
# script:
# - npx hexo clean && npx hexo g
# - "LIVE_URL=$(netlify deploy --json --dir=public/ -s $NETLIFY_SITE_ID -a $NETLIFY_AUTH_TOKEN | grep -oP '(?<=\"deploy_url\": \")[^\"]*')"
# - "curl -X POST -H 'Content-type: application/json' --data '{\"text\": \"$CI_PROJECT_NAME deployato con successo dal branch $CI_COMMIT_REF_NAME, $LIVE_URL\"}' $SLACK_WEBHOOK_URL"
# only:
# - branches
# when: manual
deploy_prod:
stage: deploy
before_script:
- npm install netlify-cli -g
- npm install
script:
- npm run generate
- "LIVE_URL=$(netlify deploy --json --prod --dir=public/ -s $NETLIFY_SITE_ID -a $NETLIFY_AUTH_TOKEN | grep -oP '(?<=\"url\": \")[^\"]*')"
- "curl -X POST $SLACK_WEBHOOK_URL -H 'Content-type: application/json' --data '{\"text\": \"Una nuova versione del sito è stata pubblicata con successo\"}'"
only:
refs:
- master