Skip to content

Commit

Permalink
feat(infra): ditch github actions, add makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
goshatch committed Feb 13, 2025
1 parent 68c60f1 commit e39eb43
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 55 deletions.
4 changes: 4 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@ root = true
end_of_line = lf
indent_style = space
indent_size = 2

[Makefile]
indent_style = tab
indent_size = 4
43 changes: 0 additions & 43 deletions .github/workflows/deploy.yml

This file was deleted.

1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
_site
build
.sass-cache
.jekyll-cache
.jekyll-metadata
Expand Down
28 changes: 28 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
.POSIX:
.PHONY: all git-meta yeet serve draft

REMOTE_HOST = bubundel
REMOTE_PATH = /var/www/gosha.net
DRAFT_DIR = _drafts
NOW = $(shell date '+%Y-%m-%d %H:%M:%S %z')
YEAR = $(shell date '+%Y')

all: yeet

git-meta:
@mkdir -p _data
@git log -1 --pretty=format:'{ "hash": "%h", "date": "%aI", "subject": "%s", "author": "%aN" }' > _data/git.json

serve:
bundle exec jekyll serve --drafts --livereload --incremental

draft:
@mkdir -p _drafts
@read -p "title: " title; \
read -p "location: " location; \
fname=$$(echo "$$title" | tr '[:upper:]' '[:lower:]' | sed 's/[^a-z0-9]/-/g' | sed 's/-\+/-/g' | sed 's/^-\|-$$//g'); \
echo "---\nlayout: post\ntitle: \"$$title\"\ndate: $(NOW)\nlocation: $$location\ncategories: []\nsummary: \"\"\nfeatured_image: /assets/images/posts/$(YEAR)\n---\n" > "$(DRAFT_DIR)/$$(date +%Y-%m-%d)-$$fname.md"

yeet: git-meta
bundle exec jekyll build
rsync -rvlh --progress --delete _site/ $(REMOTE_HOST):$(REMOTE_PATH)
3 changes: 0 additions & 3 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,8 @@ plugins:
- jekyll/mastodon_webfinger

exclude:
- updategitinfo.sh
- README.md

destination: build

jekyll-figure:
paragraphs: false

Expand Down
Empty file added _drafts/.keep
Empty file.
9 changes: 5 additions & 4 deletions colophon.html
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,16 @@ <h3>Accessibility</h3>

<section>
<h3>Build information</h3>
{%- assign commit = site.data.git -%}
<p>
Last updated on {{ site.data.git.date | readableDate }}<br />
Last updated on {{ commit.date | readableDate }}<br />
<code
><a
href="https://github.com/goshatch/gosha.net/commit/{{ site.data.git.commitHash }}"
>{{ site.data.git.commitHash }}</a
href="https://github.com/goshatch/gosha.net/commit/{{ commit.hash }}"
>{{ commit.hash }}</a
></code
>
&rarr; {{ site.data.git.subject }}
&rarr; {{ commit.subject }}
</p>
<p>
Made with <i class="twa twa-red-heart"></i> in London
Expand Down
4 changes: 0 additions & 4 deletions updategitinfo.sh

This file was deleted.

0 comments on commit e39eb43

Please sign in to comment.