version: '3' tasks: install: desc: Setup VitePress locally # start:all reaches this task through two parallel branches, and pnpm does # not expect two installs at once. run: once cmds: - pnpm install sources: - package.json - pnpm-lock.yaml default: desc: Start website deps: [install] aliases: [s, start, start:next] vars: HOST: '{{default "0.0.0.0" .HOST}}' PORT: '{{default "3001" .PORT}}' env: DOCS_CHANNEL: '{{.CHANNEL | default "next"}}' # Only the dev server sets this: it is what keeps the localhost URLs of # the version selector out of a build. See .vitepress/config.ts. DOCS_LOCAL: '1' cmds: - pnpm dev --host={{.HOST}} --port={{.PORT}} # The port is half of a pair: config.ts links the two channels to each other # on 3001 and 3002, so both dev servers can run side by side. start:latest: desc: Start website with the content of the released version cmds: - task: default vars: { CHANNEL: latest, PORT: '{{default "3002" .PORT}}' } start:all: desc: Start both channels side by side deps: [default, start:latest] lint: desc: Lint website deps: [install] cmds: - pnpm lint build: desc: Build website aliases: [build:next] deps: [install] env: DOCS_CHANNEL: '{{.CHANNEL | default "next"}}' cmds: - pnpm build build:latest: desc: Build website with the content of the released version cmds: - task: build vars: { CHANNEL: latest } preview: desc: Preview Website deps: [build] aliases: [serve] vars: HOST: '{{default "localhost" .HOST}}' PORT: '{{default "3001" .PORT}}' cmds: - pnpm preview --host={{.HOST}} --port={{.PORT}} clean: desc: Clean temp directories cmds: - rm -rf ./vitepress/dist # --no-build is what makes the channel stick: the CLI builds by default, and # that build would come from netlify.toml, which knows nothing about the # channel these tasks just built. deploy:next: desc: Build and deploy next.taskfile.dev deps: [build:next] cmds: - pnpm netlify deploy --prod --no-build --site=4e13dfcf-fc0d-4bec-ad60-b918a8dc3942 deploy:prod: desc: Build and deploy taskfile.dev deps: [build:latest] cmds: - pnpm netlify deploy --prod --no-build --site=e625bc6a-1cd3-465d-ad30-7bbddaeb4f31