Only run on main branch
This commit is contained in:
parent
d85111c863
commit
13d89e2d52
7
Jenkinsfile
vendored
7
Jenkinsfile
vendored
@ -3,6 +3,13 @@ def deploy() {
|
|||||||
try {
|
try {
|
||||||
checkout scm
|
checkout scm
|
||||||
|
|
||||||
|
// Only deploy from main branch
|
||||||
|
def branch = env.BRANCH_NAME ?: sh(script: 'git rev-parse --abbrev-ref HEAD', returnStdout: true).trim()
|
||||||
|
if (branch != 'main') {
|
||||||
|
echo "Skipping deployment: not on main branch (current branch: ${branch})"
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
nodejs(nodeJSInstallationName: 'Node23') {
|
nodejs(nodeJSInstallationName: 'Node23') {
|
||||||
stage('Install') {
|
stage('Install') {
|
||||||
sh 'yarn install --frozen-lockfile --production=false'
|
sh 'yarn install --frozen-lockfile --production=false'
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user