added woodpecker build

This commit is contained in:
Ell 2023-07-10 17:31:04 +02:00
parent 54e17968b5
commit 204578396c
2 changed files with 29 additions and 40 deletions

29
.woodpecker/main.yml Normal file
View file

@ -0,0 +1,29 @@
steps:
build-web:
image: ruby:latest
commands:
- cd web && bundle && bundle exec jekyll build
build-docs:
image: mcr.microsoft.com/dotnet/sdk:7.0.305
commands:
- cd docs && dotnet tool restore && dotnet docfx
deploy-web:
image: debian:latest
when:
- event: [push, manual]
branch: main
commands:
- rm -rfv /var/www/tinylifegame/*
- cp -rv web/_site/. /var/www/tinylifegame
volumes:
- /var/www/tinylifegame:/var/www/tinylifegame
deploy-docs:
image: debian:latest
when:
- event: [push, manual]
branch: main
commands:
- rm -rfv /var/www/tinylifedocs/*
- cp -rv docs/_site/. /var/www/tinylifedocs
volumes:
- /var/www/tinylifedocs:/var/www/tinylifedocs

40
Jenkinsfile vendored
View file

@ -1,40 +0,0 @@
pipeline {
agent none
stages {
stage('Build') {
agent any
stages {
stage('Site') {
steps {
sh '''cd web
bundle
bundle exec jekyll build'''
stash includes: "web/_site/**", name: "site"
}
}
stage('Docs') {
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/'
}
}
}
}