diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..0e4c927 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,35 @@ +kind: pipeline +name: default + +steps: +- name: build + image: silex/emacs:27 + commands: + - pwd + - ls -ahl + - which emacs + - emacs --script export.el + +- name: deploy + image: appleboy/drone-scp + settings: + host: + from_secret: ssh_host + target: + from_secret: ssh_target + source: + - !org/config/LICENSE.md + - org/config/*.html + strip_components: 2 + username: + from_secret: ssh_username + password: + from_secret: ssh_password + port: + from_secret: ssh_port + when: + branch: + - master + event: + exclude: + - pull_request diff --git a/export.el b/export.el new file mode 100755 index 0000000..2df70fa --- /dev/null +++ b/export.el @@ -0,0 +1,21 @@ +#!/usr/bin/emacs --script +(require 'package) +(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t) +(package-initialize) +(package-refresh-contents) +(package-install 'htmlize) +(package-install 's) +(require 's) +(setq org-confirm-babel-evaluate nil) +(let* ((files (mapcar #'expand-file-name + (file-expand-wildcards "org/config/*.org")))) + (mapc (lambda (file) + (message (format "==========\nExporting %S\n==========" file)) + (with-current-buffer (find-file file) + (org-html-export-to-html))) + files)) +(let* ((files (mapcar #'expand-file-name + (file-expand-wildcards "org/config/*.html~")))) + (mapc (lambda (file) + (delete-file file)) + files))