TinyLifeWeb/Jenkinsfile

41 lines
936 B
Plaintext
Raw Normal View History

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'''
2023-04-26 12:41:43 +02:00
stash includes: "web/_site/**", name: "site"
2023-04-26 12:02:26 +02:00
}
}
stage('Docs') {
steps {
sh '''cd docs
dotnet tool restore
dotnet docfx'''
2023-04-26 12:41:43 +02:00
stash includes: "docs/_site/**", name: "docs"
2023-04-26 12:02:26 +02:00
}
}
}
2023-04-26 12:02:26 +02:00
}
stage('Publish') {
when { branch 'main' }
agent { label 'web' }
options { skipDefaultCheckout() }
steps {
2023-04-26 12:02:26 +02:00
unstash 'site'
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
}