chore: create deploy step for nextjs apps (#76)

This commit is contained in:
Sasha 2024-07-23 14:33:08 +02:00 committed by GitHub
parent 63e0c053ca
commit 1d033912be
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 11 additions and 1 deletions

12
ci/Jenkinsfile vendored
View File

@ -42,7 +42,7 @@ pipeline {
stage('experimental/rln-js') { steps { script { buildExample() } } } stage('experimental/rln-js') { steps { script { buildExample() } } }
stage('experimental/rln-identity') { steps { script { buildExample() } } } stage('experimental/rln-identity') { steps { script { buildExample() } } }
stage('dogfooding') { steps { script { buildExample() } } } stage('dogfooding') { steps { script { buildExample() } } }
stage('flush-notes') { steps { script { buildExample() } } } stage('flush-notes') { steps { script { buildNextJSExample() } } }
} }
} }
@ -77,6 +77,16 @@ def buildExample(example=STAGE_NAME) {
} }
} }
def buildNextJSExample(example=STAGE_NAME) {
def dest = "${WORKSPACE}/build/docs/${example}"
dir("examples/${example}") {
sh 'npm install --silent'
sh 'npm run build'
sh "mkdir -p ${dest}"
sh "cp -r out/. ${dest}"
}
}
def copyExample(example=STAGE_NAME) { def copyExample(example=STAGE_NAME) {
def source = "examples/${example}" def source = "examples/${example}"
def dest = "build/docs/${example}" def dest = "build/docs/${example}"