-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathJenkinsfile
47 lines (47 loc) · 1.3 KB
/
Jenkinsfile
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
pipeline {
agent {
docker {
image 'node:lts-bullseye' // node 18 lts & debian 11 based image with git clie
args '-p 3000:3000'
}
}
stages {
stage('Install Dependencies') {
when {
expression {
// skip gh-pages branch builds
return env.BRANCH_NAME != 'gh-pages';
}
}
steps {
sh 'npm install'
}
}
stage('Build & Deploy Branch') {
environment {
// 'data team jenkins' credentials
GH_TOKEN = credentials('b7544320-e084-4912-a1c5-b330585aa8ee')
}
when {
expression {
return env.BRANCH_NAME != 'master' && env.BRANCH_NAME != 'gh-pages';
}
}
steps {
sh 'npm run deploy-branch'
}
}
stage('Build & Deploy Main') {
environment {
// 'data team jenkins' credentials
GH_TOKEN = credentials('b7544320-e084-4912-a1c5-b330585aa8ee')
}
when {
branch 'master'
}
steps {
sh 'npm run deploy'
}
}
}
}