~whereiseveryone/public-inbox

website: Automate the deployment using builds.sr.ht v1 APPLIED

Dhruvin Gandhi: 1
 Automate the deployment using builds.sr.ht

 3 files changed, 33 insertions(+), 0 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~whereiseveryone/public-inbox/patches/28078/mbox | git am -3
Learn more about email & git

[PATCH website] Automate the deployment using builds.sr.ht Export this patch

---
 .build.yml   | 21 +++++++++++++++++++++
 guixrus.scm  | 10 ++++++++++
 manifest.scm |  2 ++
 3 files changed, 33 insertions(+)
 create mode 100644 .build.yml
 create mode 100644 guixrus.scm

diff --git a/.build.yml b/.build.yml
new file mode 100644
index 0000000..0a5df78
--- /dev/null
+++ b/.build.yml
@@ -0,0 +1,21 @@
image: guix
oauth: pages.sr.ht/PAGES:RW
sources:
- https://git.sr.ht/~whereiseveryone/guixrus
- https://git.sr.ht/~whereiseveryone/website
tasks:
- guix: |
    cd website
    GUIX_PACKAGE_PATH=../guixrus guix package -v0 -m manifest.scm
- guixrus-json: |
    cd website
    GUIX_PACKAGE_PATH=../guixrus guile guixrus.scm > guixrus.json
- publish: |
    cd website
    mkdir -p site capsule
    cat guixrus.json | jinja2 index-html.jinja2  > site/index.html
    cat guixrus.json | jinja2 index-gmi.jinja2 > capsule/index.gmi
    cd site && tar -cvz . > ../site.tar.gz && cd -
    cd capsule && tar -cvz . > ../capsule.tar.gz && cd -
    acurl -Fcontent=@site.tar.gz https://pages.sr.ht/publish/whereiseveryone.srht.site
    acurl -Fcontent=@capsule.tar.gz -Fprotocol=GEMINI https://pages.sr.ht/publish/whereiseveryone.srht.site
diff --git a/guixrus.scm b/guixrus.scm
new file mode 100644
index 0000000..26f1dff
--- /dev/null
+++ b/guixrus.scm
@@ -0,0 +1,10 @@
(use-modules (json))
(use-modules (gnu packages))
(use-modules (doug))

(scm->json
  `((packages	. ,(list->vector
		     (fold-packages
		       (lambda (p ps) (cons (package->alist p) ps))
		       '()
		       #:select? (negate guix-package?))))))
diff --git a/manifest.scm b/manifest.scm
index 1ff0b37..8a8aa63 100644
--- a/manifest.scm
+++ b/manifest.scm
@@ -1,4 +1,6 @@
(specifications->manifest
  '("doug"
    "guile"
    "guile-json"
    "python-jinja2-cli"))

-- 
2.34.1