-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathTaskfile.yml
More file actions
103 lines (103 loc) · 2.86 KB
/
Copy pathTaskfile.yml
File metadata and controls
103 lines (103 loc) · 2.86 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
103
# Astro-based personal site build configuration
version: '3'
output: prefixed
silent: true
env:
VOLTA_HOME: "$HOME/.volta"
PATH: "$HOME/.volta/bin:$PATH"
DOCKER_BUILDKIT: 1
vars:
DATA_DIR: ./data
GIT_COMMIT:
sh: git log -n 1 --format=%h
TODAY: '{{now | date "2006-01-02"}}'
YEAR: '{{now | date "2006"}}'
MONTH: '{{now | date "01"}}'
DAY: '{{now | date "02"}}'
TODAY_UTC: '{{ now | date "2006-01-02T15:04:05-07:00" }}'
black: \033[:0;30m
red: \033[:0;31m
green: \033[:0;32m
orange: \033[:0;33m
blue: \033[:0;34m
purple: \033[:0;35m
cyan: \033[:0;36m
light_gray: \033[:0;37m
dark_gray: \033[:1;30m
light_red: \033[:1;31m
light_green: \033[:1;32m
yellow: \033[:1;33m
light_blue: \033[:1;34m
light_purple: \033[:1;35m
light_cyan: \033[:1;36m
white: \033[:1;37m
nocolor: \u001b[0m
reversed: \u001b[7m
tasks:
default:
cmds:
- task: list
list:
desc: list tasks
cmds:
- task --list
vars:
desc: variable output
cmds:
- |
echo -e "{{.light_gray}}=== ℹ {{ .reversed }} Variable Info from Task {{ .nocolor }} === "
echo -e "{{.light_gray}}TODAY {{.nocolor}}: {{ .orange}}{{ .TODAY }} {{ .nocolor }}"
echo -e "{{.light_gray}}TODAY_UTC {{.nocolor}}: {{ .orange}}{{ .TODAY_UTC }} {{ .nocolor }}"
echo -e "{{.light_gray}}GIT_COMMIT {{.nocolor}}: {{ .orange}}{{ .GIT_COMMIT }} {{ .nocolor }}"
serve:
desc: Start Astro development server
cmds:
- task: astro:serve
build:
desc: Build Astro site for production
cmds:
- task: astro:build
preview:
desc: Preview Astro production build locally
cmds:
- task: astro:preview
echo-debug:
desc: output variables for debugging netlify or other build tasks
cmds:
- git status --porcelain
- export GIT_COMMIT_SHA=`git rev-parse --verify HEAD`
- export GIT_COMMIT_SHA_SHORT=`git rev-parse --short HEAD`
- echo "GIT_COMMIT_SHA = $GIT_COMMIT_SHA"
- echo "GIT_COMMIT_SHA_SHORT = $GIT_COMMIT_SHA_SHORT"
- echo "NODE_VERSION = $(node --version)"
- echo "YARN_VERSION = $(yarn --version)"
init:
desc: Initialize project to ensure dependencies and tooling is ready
cmds:
- task: astro:install
- hk install --mise
fmt:
desc: Auto-fix formatting and linting issues
cmds:
- hk run fix
check:
desc: Run all linters without fixing
cmds:
- hk run check
# === Astro Tasks ===
astro:serve:
desc: Start Astro development server
cmds:
- yarn dev
astro:build:
desc: Build Astro site for production
cmds:
- yarn build
astro:preview:
desc: Preview Astro production build
cmds:
- yarn preview
astro:install:
desc: Install Astro dependencies (runs yarn install - lockfile will be immutable in CI)
cmds:
- yarn install