-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
67 lines (58 loc) · 1.44 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
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
# This file is a template, and might need editing before it works on your project.
# Official framework image. Look for the different tagged releases at:
# https://hub.docker.com/r/library/node/tags/
image: node:10.21.0
# Pick zero or more services to be used on all builds.
# Only needed when using a docker container to run your tests in.
# Check out: http://docs.gitlab.com/ce/ci/docker/using_docker_images.html#what-is-a-service
# services:
# - mysql:latest
# - redis:latest
# - postgres:latest
# This folder is cached between builds
# http://docs.gitlab.com/ce/ci/yaml/README.html#cache
cache:
paths:
- node_modules/
variables:
OUTPUT_DIR: "_book/"
# NETLIFY keys should be handled safely via CI/CD pipelines
# NETLIFY_AUTH_TOKEN: ""
# NETLIFY_SITE_ID: ""
# define stages
stages:
- build
- preview
- deploy
# define before script
before_script:
- npm prune
- npm install
# define jobs
build_job:
stage: build
script:
- npm run build
artifacts:
paths:
- "_book/"
only:
- branches
preview_job:
stage: preview
script:
- node_modules/.bin/netlify deploy --dir=_book --auth $NETLIFY_AUTH_TOKEN --site $NETLIFY_SITE_ID
dependencies:
- build_job
only:
- branches
deploy_job:
stage: deploy
script:
- node_modules/.bin/netlify deploy --dir=_book --auth $NETLIFY_AUTH_TOKEN --site $NETLIFY_SITE_ID --prod
dependencies:
- build_job
when: manual
only:
- master
- main