2021-08-04 05:42:02 +02:00
|
|
|
pipeline {
|
2023-04-26 12:02:26 +02:00
|
|
|
agent none
|
2021-08-04 05:42:02 +02:00
|
|
|
stages {
|
2023-04-26 12:02:26 +02:00
|
|
|
stage('Build') {
|
|
|
|
agent any
|
|
|
|
stages {
|
|
|
|
stage('Site') {
|
|
|
|
steps {
|
|
|
|
sh '''cd web
|
|
|
|
bundle
|
|
|
|
bundle exec jekyll build'''
|
|
|
|
stash includes: "web/_site/.", name: "docs"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
stage('Docs') {
|
|
|
|
steps {
|
|
|
|
sh '''cd docs
|
|
|
|
dotnet tool restore
|
|
|
|
dotnet docfx'''
|
|
|
|
stash includes: "docs/_site/.", name: "docs"
|
|
|
|
}
|
|
|
|
}
|
2021-12-01 10:52:57 +01:00
|
|
|
}
|
2023-04-26 12:02:26 +02:00
|
|
|
}
|
|
|
|
stage('Publish') {
|
|
|
|
when { branch 'main' }
|
|
|
|
agent { label 'web' }
|
|
|
|
options { skipDefaultCheckout() }
|
2021-12-01 10:52:57 +01:00
|
|
|
steps {
|
2023-04-26 12:02:26 +02:00
|
|
|
unstash 'site'
|
2021-12-01 10:52:57 +01:00
|
|
|
sh 'rm -rf /var/www/tinylifegame/*'
|
2022-01-23 15:58:04 +01:00
|
|
|
sh 'cp -r web/_site/. /var/www/tinylifegame/'
|
2023-04-26 12:02:26 +02:00
|
|
|
|
|
|
|
unstash 'docs'
|
2021-11-26 19:42:45 +01:00
|
|
|
sh 'rm -rf /var/www/tinylifedocs/*'
|
2023-02-09 22:25:41 +01:00
|
|
|
sh 'cp -r docs/_site/. /var/www/tinylifedocs/'
|
2021-08-04 05:42:02 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2023-02-09 22:25:41 +01:00
|
|
|
}
|