build: update CI

This commit is contained in:
Lucien Cartier-Tilet 2023-05-11 00:23:21 +02:00
parent cc0a479550
commit 5e9c717e1e
Signed by: phundrak
GPG Key ID: BD7789E705CB8DCA
2 changed files with 71 additions and 11 deletions

View File

@ -4,35 +4,66 @@ type: docker
name: CD
steps:
- name: restore cache
- name: restore cache node
image: drillster/drone-volume-cache
volumes:
- name: cache
path: /cache
- name: main-website-node
path: /cache/phundrak.com/node
settings:
restore: true
mount:
- ./node_modules
- name: generate
- name: restore cache emacs
image: drillster/drone-volume-cache
volumes:
- name: main-website-emacs
path: /cache/phundrak.com/emacs
settings:
restore: true
mount:
- /root/.emacs.d
- name: generate emacs
image: silex/emacs:master-alpine
commands:
- apk update && apk add git
- emacs -Q --script export.el
depends_on:
- "restore cache emacs"
- name: generate node
image: node:19-alpine
commands:
- yarn install
- yarn build
depends_on:
- "restore cache"
- "restore cache node"
- "generate emacs"
- name: rebuild cache
- name: rebuild cache emacs
image: drillster/drone-volume-cache
volumes:
- name: cache
path: /cache
- name: conlang-emacs
path: /cache/conlang/emacs
settings:
rebuild: true
mount:
- /root/.emacs.d
depends_on:
- "generate emacs"
- name: rebuild cache node
image: drillster/drone-volume-cache
volumes:
- name: main-website-node
path: /cache/phundrak.com/node
settings:
rebuild: true
mount:
- ./node_modules
depends_on:
- generate
- "generate node"
- name: deploy stable
image: appleboy/drone-scp
@ -50,7 +81,7 @@ steps:
port:
from_secret: ssh_port
depends_on:
- generate
- "generate node"
when:
branch:
- main
@ -93,7 +124,7 @@ steps:
port:
from_secret: ssh_port
depends_on:
- generate
- "generate node"
when:
branch:
- devel

29
export.el Normal file
View File

@ -0,0 +1,29 @@
(require 'package)
(require 'org)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/"))
(package-initialize)
(package-refresh-contents)
(package-install 'f)
(package-install 'ox-gfm)
(require 'f)
(require 'ox-gfm)
(require 'ox-publish)
(setq org-confirm-babel-evaluate nil
org-html-validation-link nil
make-backup-files nil
org-export-with-broken-links t)
(defvar project-root
(file-name-as-directory (expand-file-name "content" default-directory)))
(message "Emacs directory: %s" (f-full user-emacs-directory))
(dolist (file (f-files project-root (lambda (file) (f-ext-p file "org")) t))
(message "====== Exporting %s" (f-relative file))
(with-temp-buffer
(find-file file)
(org-export-to-file 'gfm (concat (f-no-ext file) ".md"))))
(message "Project generated!")