docs.status.network/Jenkinsfile
markoburcul 7a9a7f56d9
build: add jenkinsfile and flake file
To be able to deploy site we need a pipeline to build it and publish it
to a branch from which our caddy-git service will pull for changes.
All of this will be done using nix flake to ease out the
build/development process.

Referenced issue: https://github.com/status-im/status-network-docs/issues/1

Signed-off-by: markoburcul <marko@status.im>
2024-10-28 13:10:23 +01:00

59 lines
1.0 KiB
Groovy

#!/usr/bin/env groovy
library 'status-jenkins-lib@v1.9.13'
pipeline {
agent { label 'linux' }
options {
disableConcurrentBuilds()
/* manage how many builds we keep */
buildDiscarder(logRotator(
numToKeepStr: '20',
daysToKeepStr: '30',
))
}
environment {
GIT_COMMITTER_NAME = 'status-im-auto'
GIT_COMMITTER_EMAIL = 'auto@status.im'
}
stages {
stage('Install') {
steps {
script {
nix.develop('yarn install')
}
}
}
stage('Build') {
steps {
script {
nix.develop('yarn build')
jenkins.genBuildMetaJSON('build/build.json')
}
}
}
stage('Publish') {
steps {
sshagent(credentials: ['status-im-auto-ssh']) {
script {
nix.develop("""
ghp-import \
-b deploy-master \
-c docs.status.network \
-p build
"""
)
}
}
}
}
}
post {
cleanup { cleanWs() }
}
}