www.byjp.me/Taskfile.yml
JP Hastings-Spital f16ee40af4
Some checks are pending
Deploy Hugo site to Pages / build (push) Waiting to run
Deploy Hugo site to Pages / deploy (push) Blocked by required conditions
Deploy Hugo site to Pages / ipfs-publish (push) Blocked by required conditions
Swap to hosting Gemini at byjp.me
2024-11-20 17:46:17 +00:00

74 lines
2.6 KiB
YAML

# https://taskfile.dev
version: '3'
vars:
domain: www.byjp.me
gmi_domain: byjp.me
puma_dev_tld: .test
env:
HUGO_INDIEKIT_URL: https://indiekit.last.pub{{.DOMAIN_SUFFIX}}
HUGO_LAST_UPDATE_TIME:
sh: git log -1 --format=%cI
HUGO_LAST_UPDATE_HASH:
sh: git log -1 --format=%h
tasks:
check-links:
desc: Check URLs across my site for linkrot.
cmds:
- lychee --cache --require-https --config lychee.toml .
dev:
desc: Run a local server that auto-updates when files are edited. (Search won't work)
silent: true
vars:
port: 1313
cmds:
- |
[ -d "$HOME/.puma-dev/" ] && (echo {{ .port }} > $HOME/.puma-dev/{{ .domain }}) || echo "Puma dev not installed, https://{{ .domain }}{{ .puma_dev_tld }} will not work"
- hugo server --bind "0.0.0.0" --port {{ .port }} --minify --printUnusedTemplates --buildDrafts --baseURL "https://{{ .domain }}{{ .puma_dev_tld }}" --appendPort=false
build:
desc: Builds the production-ready site in ./public/
vars:
cache: /tmp/hugo/cache
cmds:
- hugo --cacheDir {{ .cache }} --gc --minify --baseURL "https://{{ .domain }}"
- pagefind
import:
desc: Pulls information from various other sites/silos into this repo. Expects `./tools/.env` to be populated.
dir: tools/
cmds:
- go run ./import/omnivore ../
- go run ./import/webmentionio
gemini-reduce:
desc: Builds the gemini capsule, removing all HTML and HTML-specific files from ./public.
silent: true
cmds:
# Gemini has no Javascript (no client-side interactivity at all), so search is useless
- rm -rf ./public/search
# Remove www-specific files
- find ./public -regextype posix-egrep -regex '.*\.(html|js|css|css\.map|webmanifest|xml|xsl|ico|opml)' -type f -delete
# Remove specific unneeded files
- rm -rf ./public/favicon*.png ./public/_redirects ./public/{apple,android,mstile}*.png ./public/safari-pinned-tab.svg ./public/robots.txt
# Remove specific unneeded directories
- rm -rf ./public/.well-known/ ./public/fonts/ ./public/standalone/project-prime/
# Remove empty directories
- find ./public -type d -empty -delete
gemini-dev:
desc: Builds the site & starts a gemini server (on the default port) for it.
cmds:
- agate --content public --addr 0.0.0.0:1965 --ed25519 --only-tls13 --hostname "{{ .gmi_domain }}{{ .puma_dev_tld }}" --central-conf
gemini-deploy:
desc: Builds, reduces, and deploys the gemini version of the site with fly.
deps:
- build
- gemini-reduce
cmds:
- fly deploy --remote-only