mirror of
https://github.com/Ellpeck/TinyLifeWeb.git
synced 2024-11-22 19:28:35 +01:00
also build web if not publishing
This commit is contained in:
parent
01a054b2e7
commit
aadb5d931b
1 changed files with 29 additions and 18 deletions
29
Jenkinsfile
vendored
29
Jenkinsfile
vendored
|
@ -1,26 +1,37 @@
|
|||
pipeline {
|
||||
agent { label 'web' }
|
||||
agent none
|
||||
stages {
|
||||
stage('Build') {
|
||||
agent any
|
||||
stages {
|
||||
stage('Site') {
|
||||
when {
|
||||
branch 'main'
|
||||
}
|
||||
steps {
|
||||
sh '''cd web
|
||||
bundle
|
||||
bundle exec jekyll build'''
|
||||
sh 'rm -rf /var/www/tinylifegame/*'
|
||||
sh 'cp -r web/_site/. /var/www/tinylifegame/'
|
||||
stash includes: "web/_site/.", name: "docs"
|
||||
}
|
||||
}
|
||||
stage('Docs') {
|
||||
when {
|
||||
branch 'main'
|
||||
}
|
||||
steps {
|
||||
sh '''cd docs
|
||||
dotnet tool restore
|
||||
dotnet docfx'''
|
||||
stash includes: "docs/_site/.", name: "docs"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Publish') {
|
||||
when { branch 'main' }
|
||||
agent { label 'web' }
|
||||
options { skipDefaultCheckout() }
|
||||
steps {
|
||||
unstash 'site'
|
||||
sh 'rm -rf /var/www/tinylifegame/*'
|
||||
sh 'cp -r web/_site/. /var/www/tinylifegame/'
|
||||
|
||||
unstash 'docs'
|
||||
sh 'rm -rf /var/www/tinylifedocs/*'
|
||||
sh 'cp -r docs/_site/. /var/www/tinylifedocs/'
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue