diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..667541c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,7 @@ +FROM ghcr.io/pengx17/logseq-base:master as build +WORKDIR /home/logseq +COPY . /work/src +RUN xvfb-run node /home/logseq/graph/publish.mjs -p /work/src -t /home/logseq/graph/build_trace.txt -o /home/logseq/graph/HTMLOutput > /home/logseq/graph/build.log + +FROM nginx +COPY --from=build /home/logseq/graph/HTMLOutput /usr/share/nginx/html \ No newline at end of file diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..8db990b --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,36 @@ +pipeline { + agent any + stages { + stage('Build Docker Image') { + environment { + version = "1.0.${env.BUILD_NUMBER}" + } + steps { + sh 'docker build --no-cache -t registry.miaostay.com/kotadoc -f Dockerfile .' + } + } + stage('Push to Registry') { + when { + anyOf { + branch 'master' + } + } + environment { + version = "1.0.${env.BUILD_NUMBER}" + } + steps { + sh 'docker push registry.miaostay.com/kotadoc' + } + } + stage('Delete Local Images') { + when { + anyOf { + branch 'master' + } + } + steps { + sh 'docker images|grep none|awk \'{print $3 }\'|xargs docker rmi' + } + } + } +}