# yaml-language-server: $schema=https://taskfile.dev/schema.json version: "3" vars: SITE_ID: sh: echo "$NETLIFY_SITE_ID" NETLIFY_AUTH_TOKEN: sh: echo "$NETLIFY_AUTH_TOKEN" secret: true BRANCH_NAME: sh: git rev-parse --abbrev-ref HEAD tasks: build: sources: - "static/**" - "**/*.go" - "**/*.svg" - "**/*.json" - "**/*.svg" - "**/*.md" - "**/*.templ" - "**/*.css" - exclude: internal/**/*_templ.go - exclude: internal/**/output.css - exclude: Readme.md cmds: - hugo dev: cmds: - hugo server --disableFastRender lint: cmds: - hugo --printPathWarnings --printI18nWarnings - markdownlint . - cspell netlify: cmds: - hugo --baseURL http://localhost:8888/site - netlify dev --dir public clean: cmds: - rm -rf public checks: cmds: - task: clean - task: lint - task: build - lychee public --root-dir "$(pwd)/public" deploy-preview: requires: vars: - SITE_ID - NETLIFY_AUTH_TOKEN - BRANCH_NAME cmds: - hugo --baseURL https://{{.BRANCH_NAME}}--dhawos-personal-site.netlify.app - netlify deploy --site {{.SITE_ID}} --auth {{.NETLIFY_AUTH_TOKEN}} --dir public --alias {{.BRANCH_NAME}} deploy: requires: vars: - SITE_ID - NETLIFY_AUTH_TOKEN cmds: - task: build - netlify deploy --site {{.SITE_ID}} --auth {{.NETLIFY_AUTH_TOKEN}} --prod --dir "public"