Repository navigation
Expand file tree
/
Copy pathTaskfile.yml
More file actions
102 lines (89 loc) · 3.93 KB
/
Copy pathTaskfile.yml
File metadata and controls
102 lines (89 loc) · 3.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
version: '3'
# ubgo.github.io: Hugo + standalone Tailwind CLI. No Node needed at build or run time.
# Tools (pinned, installed into ~/.local/bin with checksums checked): see `task tools`.
vars:
HUGO_VERSION: 0.167.0
TAILWIND_VERSION: 4.3.3
BIN: '{{.HOME}}/.local/bin'
BRAND: ../brand
PROFILE: ../profile
tasks:
tools:
desc: Install pinned Hugo extended and the Tailwind standalone CLI into ~/.local/bin (checksums checked)
cmds:
- sh scripts/install-tools.sh {{.HUGO_VERSION}} {{.TAILWIND_VERSION}} {{.BIN}}
status:
- '{{.BIN}}/hugo version | grep -q "v{{.HUGO_VERSION}}-.*+extended"'
- '{{.BIN}}/tailwindcss --help | grep -q "v{{.TAILWIND_VERSION}}"'
brand:
desc: Copy the logo, favicons, social card, brand.json and every brand asset from ../brand into the site
cmds:
- cp {{.BRAND}}/favicon.ico {{.BRAND}}/favicon.svg {{.BRAND}}/icon.svg static/
- cp {{.BRAND}}/png/apple-touch-icon.png {{.BRAND}}/png/og-card.png {{.BRAND}}/png/ubgo-icon-512.png static/
- mkdir -p content-preview/preview static/brand/png
- cp {{.BRAND}}/concepts/*.svg {{.BRAND}}/ubgo-lockup.svg {{.BRAND}}/ubgo-lockup-dark.svg {{.BRAND}}/og-card.svg {{.BRAND}}/og-card-light.svg content-preview/preview/
- cp {{.BRAND}}/*.svg {{.BRAND}}/favicon.ico static/brand/
- cp {{.BRAND}}/png/*.png static/brand/png/
- cp {{.BRAND}}/brand.json data/brand.json
- python3 -I scripts/brand-zip.py {{.BRAND}} static/brand/ubgo-brand.zip
facts:
desc: Refresh data/facts/*.json from shallow clones of every public repo (needs network; fetches with timeouts and retries, fails if any repo cannot be fetched)
vars:
CLONES: '{{.CLONES | default ".facts-clones"}}'
cmds:
- sh scripts/fetch-facts.sh {{.CLONES}} data/libraries.yaml
- python3 -I scripts/facts.py {{.CLONES}} data/libraries.yaml data/facts
og:
desc: Regenerate static/og/<library>.png social cards from data/libraries.yaml and data/brand.json (needs Node)
dir: scripts/og
cmds:
- npm ci --no-audit --no-fund --silent
- node gen-og.mjs
css:
desc: Build assets/css/site.css with the Tailwind CLI
cmds:
- '{{.BIN}}/tailwindcss -i assets/css/main.css -o assets/css/site.css --minify'
build:
desc: Production build into public/ (no /preview/ page)
cmds:
- task: css
- rm -rf public
- '{{.BIN}}/hugo --minify --environment production --panicOnWarning'
serve:
desc: Preview server through portless at https://ubgo.shipd.fyi (owner login only)
cmds:
- portless --name ubgo ./serve.sh
profile:
desc: Regenerate ../profile/profile/README.md from data/libraries.yaml
cmds:
- rm -rf .profile-out
- '{{.BIN}}/hugo --environment profile --destination .profile-out --quiet'
- mkdir -p {{.PROFILE}}/profile
- cp .profile-out/profile-readme/readme.md {{.PROFILE}}/profile/README.md
- cp {{.BRAND}}/png/ubgo-icon-512.png {{.PROFILE}}/profile/ubgo-icon-512.png
- rm -rf .profile-out
linkcheck:
desc: Build, then check every internal link and asset in public/ resolves
cmds:
- task: build
- python3 scripts/linkcheck.py public
check:
desc: Everything before publishing (profile in sync, build with no warnings, link check)
cmds:
- task: profile
- task: linkcheck
publish:pages:
desc: 'Build and force-push public/ to the gh-pages branch of ubgo/ubgo.github.io (needs push access; no GitHub Actions)'
prompt: This pushes the production build to github.com/ubgo/ubgo.github.io (gh-pages). Continue?
cmds:
- task: check
- test -f public/.nojekyll
- rm -rf public/.git
- git -C public init -q -b gh-pages
- git -C public add -A
- git -C public commit -q -m "Build from {{.SRC_COMMIT}}"
- git -C public push -f git@github.com:ubgo/ubgo.github.io.git gh-pages
- rm -rf public/.git
vars:
SRC_COMMIT:
sh: git rev-parse --short HEAD