Skip to content

Commit

Permalink
start of some code to build from
Browse files Browse the repository at this point in the history
  • Loading branch information
grahamcarlyle committed Nov 20, 2024
1 parent eaa19a6 commit a499a72
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 3 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/push.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: push to github pages

on:
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Prepare Java
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '21'
- name: Setup Clojure
uses: DeLaGuardo/[email protected]
with:
cli: 1.12.0.1479
- name: Build html
run: clj -X com.grahamcarlyle.blog/build :output-dir '"public"'
- name: Upload pages artifact
uses: actions/upload-pages-artifact@v2
with:
path: public/
deploy:
needs: build
permissions:
contents: read
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- uses: actions/deploy-pages@v2
id: deployment
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
*.iml
.idea
.cpcache
4 changes: 4 additions & 0 deletions deps.edn
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{:paths ["src" "resources"]
:deps {org.clojure/clojure {:mvn/version "1.12.0"}
babashka/fs {:mvn/version "0.4.19"}
hiccup/hiccup {:mvn/version "2.0.0-RC3"}}}
3 changes: 0 additions & 3 deletions index.html

This file was deleted.

22 changes: 22 additions & 0 deletions src/com/grahamcarlyle/blog.clj
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
(ns com.grahamcarlyle.blog
(:require
[babashka.fs :as fs]
[clojure.java.io :as io]
[hiccup2.core :as h]))

(defn declaration-of-intent []
(h/html [:div
[:p "Declaration of intent to share scrappy fiddles."]
[:p
"I'm still thinking about whether I am compelled to "
[:a
{:href "https://www.todepond.com/sky/normalise-dont-share-lol/"}
"normalise sharing scrappy fiddles"]]]))

(defn build [{:keys [output-dir]}]
(fs/create-dirs "output")
(spit (io/file output-dir "index.html") (declaration-of-intent)))

(comment
(build {:output-dir "output"})
)

0 comments on commit a499a72

Please sign in to comment.