commit e5cdaf400c0881508d07a4ac6930a778fe80e1f0
parent 65a06ddfb0c238ad6e7cfa5f0b9b13ddcc738e4c
Author: Yersa Nordman <yersa@finwo.nl>
Date: Tue, 14 Mar 2023 20:49:23 +0100
Test starting of the docs workflow
Diffstat:
4 files changed, 104 insertions(+), 0 deletions(-)
diff --git a/.github/workflows/docs-build-and-deploy.yml b/.github/workflows/docs-build-and-deploy.yml
@@ -0,0 +1,30 @@
+name: Build and Deploy
+on: [push]
+
+permissions:
+ contents: write
+
+jobs:
+ build-and-deploy:
+ concurrency: ci-${{ github.ref }}
+ runs-on: ubuntu-latest
+ steps:
+
+ - name: Checkout
+ uses: actions/checkout@v3
+
+ - name: Setup Node.JS
+ uses: actions/setup-node@v3
+
+ - name: Install and Build
+ run: |
+ sudo apt-get install -yq pandoc
+ cd doc
+ npm ci
+ npm start
+
+ - name: Deploy
+ uses: JamesIves/github-pages-deploy-action@v4
+ with:
+ folder: docs/dist
+
diff --git a/.gitignore b/.gitignore
@@ -2,3 +2,4 @@
/lib/
/pmlag
*.o
+/docs/dist
diff --git a/doc/build.js b/doc/build.js
@@ -0,0 +1,60 @@
+#!/usr/bin/env node
+
+console.log('hello world');
+
+// const fs = require('fs');
+// const esbuild = require('esbuild');
+// const webpackConfig = require('./webpack.config');
+
+// const buildList = [];
+// const styles = [];
+
+// // Re-use webpack config for entrypoints
+// for(let [name, path] of Object.entries(webpackConfig.entry)) {
+
+// // Fix node_modules reference
+// if (path.substr(0, 1) !== '.') path = `../node_modules/${path}`;
+
+// // Fix missing extension
+// if (!~['js','ts'].indexOf(path.split('.').pop())) path = `${path}.js`;
+
+// // Run the actual build
+// let cfg;
+// const res = esbuild.buildSync(cfg = {
+// format: 'cjs',
+// target: 'es6',
+// bundle: true,
+// outfile: __dirname + `/dist/${name}.bundle.js`,
+// entryPoints: [path],
+// loader: {
+// '.ttf': 'dataurl',
+// },
+// });
+
+// console.log({cfg, res});
+
+// // Record file to load
+// buildList.push(`${name}.bundle.js`);
+// try {
+// fs.statSync(__dirname + `/dist/${name}.bundle.css`);
+// styles.push(`${name}.bundle.css`);
+// } catch(e) {
+// // Intentionally empty
+// }
+// }
+
+// fs.writeFileSync(__dirname + `/dist/index.html`, `
+// <!DOCTYPE html>
+// <html>
+// <head>
+// <meta charset="utf-8">
+// <title>${webpackConfig.plugins[0].title}x</title>}
+// <meta name="viewport" content="width=device-width, initial-scale=1">
+// ${styles.map(name => `<link rel="stylesheet" href="${name}"/>`).join('')}
+// ${buildList.map(name => `<script defer src="${name}"></script>`).join('')}
+// </head>
+// <body>
+// </body>
+// </html>
+// `);
+
diff --git a/doc/package.json b/doc/package.json
@@ -0,0 +1,13 @@
+{
+ "name": "doc",
+ "version": "1.0.0",
+ "description": "",
+ "main": "build.js",
+ "scripts": {
+ "test": "echo \"Error: no test specified\" && exit 1",
+ "start": "node $(jq .main < package.json)"
+ },
+ "keywords": [],
+ "author": "",
+ "license": "ISC"
+}