mirror of
https://github.com/go-task/task.git
synced 2026-08-29 10:08:27 +02:00
feat(website): serve the released docs from a versioned copy (#2979)
This commit is contained in:
@@ -3,6 +3,9 @@ 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:
|
||||
@@ -12,13 +15,30 @@ tasks:
|
||||
default:
|
||||
desc: Start website
|
||||
deps: [install]
|
||||
aliases: [s, start]
|
||||
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]
|
||||
@@ -27,10 +47,19 @@ tasks:
|
||||
|
||||
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]
|
||||
@@ -46,12 +75,17 @@ tasks:
|
||||
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 --site=4e13dfcf-fc0d-4bec-ad60-b918a8dc3942
|
||||
- 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 --site=e625bc6a-1cd3-465d-ad30-7bbddaeb4f31
|
||||
- pnpm netlify deploy --prod --no-build --site=e625bc6a-1cd3-465d-ad30-7bbddaeb4f31
|
||||
|
||||
Reference in New Issue
Block a user