feature: add CD to project
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Lucien Cartier-Tilet 2023-02-26 21:18:22 +01:00
parent f42af20d4b
commit 51b575477f
Signed by: phundrak
GPG Key ID: BD7789E705CB8DCA
6 changed files with 1842 additions and 3 deletions

112
.drone.yml Normal file
View File

@ -0,0 +1,112 @@
---
kind: pipeline
type: docker
name: CD
steps:
- name: restore cache node
image: drillster/drone-volume-cache
volumes:
- name: conlang-node
path: /cache/conlang/node
settings:
restore: true
mount:
- ./node_modules
- name: restore cache emacs
image: drillster/drone-volume-cache
volumes:
- name: conlang-emacs
path: /cache/conlang/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 config.el
- pwd
- find / -name '*.org'
- find / -name '*.md'
depends_on:
- "restore cache emacs"
- name: generate node
image: node:19-alpine
commands:
- yarn --frozen-lockfile
- yarn docs:build
depends_on:
- "restore cache node"
- "generate emacs"
- name: rebuild cache emacs
image: drillster/drone-volume-cache
volumes:
- 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: conlang-node
path: /cache/conlang/node
settings:
rebuild: true
mount:
- ./node_modules
depends_on:
- "generate node"
- name: deploy
image: appleboy/drone-scp
settings:
host:
from_secret: ssh_host
target:
from_secret: ssh_target
source: docs/.vuepress/dist/*
strip_components: 3
username:
from_secret: ssh_username
password:
from_secret: ssh_password
port:
from_secret: ssh_port
depends_on:
- "generate node"
when:
branch:
- main
event:
exclude:
- pull_request
- name: purge cache
image: jetrails/drone-cloudflare-caching
settings:
api_token:
from_secret: cloudflare_cache_api
zone_identifier:
from_secret: phundrak_com_zone_id
action: purge_files
list:
- https://conlang.phundrak.com
depends_on:
- "deploy"
when:
branch:
- devel
event:
exclude:
- pull_request

1
.gitignore vendored
View File

@ -2,5 +2,4 @@ node_modules
.temp .temp
.cache .cache
/docs/**/*.md /docs/**/*.md
/yarn.lock
/docs/.vuepress/dist/ /docs/.vuepress/dist/

View File

@ -3,7 +3,7 @@
#+html: <a href="https://www.gnu.org/software/emacs/"><img src="https://img.shields.io/badge/Emacs-28.0.91-blueviolet.svg?style=flat-square&logo=GNU%20Emacs&logoColor=white" /></a> #+html: <a href="https://www.gnu.org/software/emacs/"><img src="https://img.shields.io/badge/Emacs-28.0.91-blueviolet.svg?style=flat-square&logo=GNU%20Emacs&logoColor=white" /></a>
#+html: <a href="https://orgmode.org/"><img src="https://img.shields.io/badge/Org%20mode-litterate%20config-success?logo=Org&logoColor=white&style=flat-square"/></a> #+html: <a href="https://orgmode.org/"><img src="https://img.shields.io/badge/Org%20mode-litterate%20config-success?logo=Org&logoColor=white&style=flat-square"/></a>
#+html: <a href="https://v2.vuepress.vuejs.org/"><img src="https://img.shields.io/badge/Framework-Vuepress-42D392?logo=Vue.js&logoColor=white&style=flat-square"/></a> #+html: <a href="https://v2.vuepress.vuejs.org/"><img src="https://img.shields.io/badge/Framework-Vuepress-42D392?logo=Vue.js&logoColor=white&style=flat-square"/></a>
#+html: <a href="https://conlang.phundrak.com"><img src="https://img.shields.io/badge/dynamic/json?label=Website&query=%24%5B%3A1%5D.status&url=https%3A%2F%2Fdrone.phundrak.com%2Fapi%2Frepos%2Fphundrak%2Fdotfiles%2Fbuilds&style=flat-square&logo=buffer" /></a> #+html: <a href="https://conlang.phundrak.com"><img src="https://img.shields.io/badge/dynamic/json?label=Website&query=%24%5B%3A1%5D.status&url=https%3A%2F%2Fdrone.phundrak.com%2Fapi%2Frepos%2Fphundrak%2conlang.phundrak.com%2Fbuilds&style=flat-square&logo=buffer" /></a>
* About the Project * About the Project
@ -52,7 +52,7 @@ install the dependencies of the project.
#+begin_src shell #+begin_src shell
yarn yarn
# or # or
npm install npm install # delete the yarn.lock file first
#+end_src #+end_src
Once this is done, you can launch a preview of the project. Once this is done, you can launch a preview of the project.

29
config.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)
(package-vc-install '(conlanging . (:url "https://labs.phundrak.com/phundrak/conlanging.el.git")))
(message "Emacs directory: %s" user-emacs-directory)
(require 'f)
(require 'ox-gfm)
(require 'ox-publish)
(setq org-confirm-babel-evaluate nil
org-html-validation-link nil
make-backup-files nil)
(defvar project-root
(file-name-as-directory (expand-file-name "docs" default-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!")

View File

@ -14,6 +14,7 @@
"author": "Lucien Cartier-Tilet <lucien@phundrak.com>", "author": "Lucien Cartier-Tilet <lucien@phundrak.com>",
"license": "AGPL-3.0", "license": "AGPL-3.0",
"devDependencies": { "devDependencies": {
"vuepress-vite": "^2.0.0-beta.60",
"vuepress": "^2.0.0-beta.60" "vuepress": "^2.0.0-beta.60"
}, },
"dependencies": { "dependencies": {

1698
yarn.lock Normal file

File diff suppressed because it is too large Load Diff