+ forgejo publishing setup

This commit is contained in:
Roland Conybeare 2026-06-07 11:21:50 -04:00
commit 00a329b382
3 changed files with 61 additions and 0 deletions

View file

@ -0,0 +1,23 @@
name: Deploy
on:
push:
branches: [main]
jobs:
publish:
runs-on: host
steps:
- name: Setup PATH
run: |
echo "/nix/var/nix/profiles/default/bin" >> $GITHUB_PATH
echo "/var/lib/forgejo-runner/.nix-profile/bin" >> $GITHUB_PATH
- name: checkout
run: |
git clone --quiet --depth=1 $GITHUB_SERVER_URL/roland/org-howto.git .
- name: publish
run: |
nix-shell shell.nix --run "./bin/howto-publish /var/www/org-howto"

28
bin/howto-publish Executable file
View file

@ -0,0 +1,28 @@
#!/usr/bin/env bash
set -euo pipefail
src_dir="$(cd "$(dirname "$0")/.." && pwd)"
dest_dir="${1:?usage: howto-publish DEST_DIR}"
mkdir -p "${dest_dir}"
emacs --batch \
--eval "(require 'ox-publish)" \
--eval "(setq org-publish-project-alist
'((\"org-howto\"
:components (\"org-howto-notes\" \"org-howto-static\"))
(\"org-howto-notes\"
:base-directory \"${src_dir}\"
:base-extension \"org\"
:publishing-directory \"${dest_dir}\"
:recursive t
:publishing-function org-html-publish-to-html
:auto-preamble t)
(\"org-howto-static\"
:base-directory \"${src_dir}\"
:base-extension \"css|html|js|svg|ico|png|jpg|gif|pdf\"
:publishing-directory \"${dest_dir}\"
:recursive t
:publishing-function org-publish-attachment)))" \
--eval "(org-publish \"org-howto\" t)"

10
shell.nix Normal file
View file

@ -0,0 +1,10 @@
{ pkgs ? import <nixpkgs> {} }:
let
emacs = (pkgs.emacsPackagesFor pkgs.emacs30).emacsWithPackages (ep: [
ep.htmlize
]);
in
pkgs.mkShell {
buildInputs = [ emacs ];
}