Skip to content
Snippets Groups Projects
Commit 58ca5c8b authored by Novak, Matus (UG - Computer Science)'s avatar Novak, Matus (UG - Computer Science)
Browse files

Added NodeJs package.json for building and publishing VuePress docs

parent 1e5d266b
No related branches found
No related tags found
No related merge requests found
......@@ -15,6 +15,8 @@ compile_gcc: &compile_gcc
ln -s $DIR/cmake-3.10.2-Linux-x86_64/bin/cmake /usr/bin/cmake
ln -s $DIR/cmake-3.10.2-Linux-x86_64/bin/cpack /usr/bin/cpack
ln -s $DIR/cmake-3.10.2-Linux-x86_64/bin/ctest /usr/bin/ctest
apt-get update
apt-get install zip
- run:
name: Init submodules
command: |
......@@ -32,6 +34,15 @@ compile_gcc: &compile_gcc
command: |
cd build
ctest --verbose -C MinSizeRel
- run:
name: Deploy
command: |
export GCC_MACHINE=$(gcc -dumpmachine)
export GCC_VERSION=$(gcc -dumpversion)
export GITHUB_REPO_TAG=$(git describe)
cd install && zip -r "../rew-$GITHUB_REPO_TAG-$GCC_MACHINE-$GCC_VERSION.zip" * && cd ..
chmod +x ./publish.sh
./publish.sh rew-$GITHUB_REPO_TAG-$GCC_MACHINE-$GCC_VERSION.zip $GITHUB_REPO_TAG
version: 2
jobs:
......@@ -59,6 +70,58 @@ jobs:
docker:
- image: gcc:8.2.0
build_docs:
docker:
- image: circleci/python:3.6
steps:
- checkout
- run:
name: Init dependencies
command: |
sudo apt install doxygen
git clone https://github.com/matusnovak/doxybook.git
cd doxybook
sudo python setup.py install
- run:
name: Build
command: |
chmod +x ./doxygen/make.sh
./doxygen/make.sh
mkdir /tmp/doxygen
cp -v ./doxygen/*.md /tmp/doxygen
- persist_to_workspace:
root: /tmp
paths:
- doxygen
upload_docs:
docker:
- image: circleci/node:9
steps:
- attach_workspace:
at: /tmp
- checkout
- run:
name: Init dependencies
command: |
sudo npm install -g vuepress
npm install
- run:
name: Build
command: |
cp -v /tmp/doxygen/*.md ./doxygen
vuepress build
- run:
name: Deploy
command: |
git config --global user.email "GITHUB_USER_EMAIL"
git config --global user.name "GITHUB_USER_NAME"
npm run publish
workflows:
version: 2
build_and_test:
......@@ -73,3 +136,17 @@ workflows:
- compile_gcc_820:
requires:
- compile_gcc_730
- build_docs:
requires:
- compile_gcc_730
filters:
branches:
only:
- master
- upload_docs:
requires:
- build_docs
filters:
branches:
only:
- master
const ghpages = require("gh-pages")
console.log("Publishing to GH Pages")
ghpages.publish('.vuepress/dist', {
repo: 'https://' + process.env.GITHUB_TOKEN + '@github.com/matusnovak/mn00272-com3001-final-year-project.git'
}, function (err) {
if (err) {
console.log(err)
process.exit(1)
}
})
{
"name": "mn00272-com3001-final-year-project",
"version": "1.0.0",
"description": "",
"repository": {
"url": "git@git@github.com:matusnovak/mn00272-com3001-final-year-project.git",
"type": "git"
},
"scripts": {
"publish": "node gh-pages.js"
},
"author": "matusnovak",
"license": "MIT",
"devDependencies": {
"gh-pages": "^2.0.1"
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment