[build]
  command = "yarn run graphql-docs && yarn run docusaurus build"

[context.production]
  ignore = "false"

[context.deploy-preview]
  ignore = "false"

[[redirects]]
  # Embargoes compliance. DO NOT REMOVE
  conditions = {Country = ["CU", "IR", "KP", "SY", "UA-43"]}
  from = "/*"
  to = "/restricted"
  status = 302
  force = true

[[redirects]]
  from = "/api/reference"
  to = "/api/reference/"
  status = 200

[[redirects]]
  # redirect single-language guide index to unified guides index
  from = "/sdk/go/275922/guides"
  to = "/guides"
  status = 302

[[redirects]]
  # redirect single-language guide index to unified guides index
  from = "/sdk/nodejs/947203/guides"
  to = "/guides"
  status = 302

[[redirects]]
  # redirect single-language guide index to unified guides index
  from = "/sdk/python/234291/guides"
  to = "/guides"
  status = 302

[[redirects]]
  # URL consistency fix
  from = "/sdk/go/406009/multiplatform-support"
  to = "/406009/multiplatform-support"
  status = 302

[[redirects]]
  # URL consistency fix
  from = "/sdk/nodejs/620941/github-google-cloud"
  to = "/620941/github-google-cloud"
  status = 302

[[redirects]]
  # URL consistency fix
  from = "/sdk/python/648384/multi-builds"
  to = "/648384/multi-builds"
  status = 302

[[redirects]]
  # redirect single-language guide to multi-language guide
  from = "/560223/private-repositories"
  to = "/710884/private-repositories"
  status = 302

[[redirects]]
  # redirect single-language guide to multi-language guide
  from = "/683293/private-repositories"
  to = "/710884/private-repositories"
  status = 302

[[redirects]]
  # redirect Go CI guide to unified multi-language CI guide
  from = "/768421/go-ci"
  to = "/145912/ci"
  status = 302

[[redirects]]
  # redirect Node.js CI guide to unified multi-language CI guide
  from = "/114934/nodejs-ci"
  to = "/145912/ci"
  status = 302

[[redirects]]
  # redirect Python CI guide to unified multi-language CI guide
  from = "/454108/python-ci"
  to = "/145912/ci"
  status = 302

[[redirects]]
  # redirect old guides index page
  from = "/278912/guides"
  to = "/guides"
  status = 302

[[redirects]]
  # redirect old cookbook index page
  from = "/7442989/cookbook"
  to = "/cookbook"
  status = 302

[[redirects]]
  # redirect old FAQ index page
  from = "/162770/faq"
  to = "/faq"
  status = 302

[[redirects]]
  # redirect old quickstart index page
  from = "/648215/quickstart"
  to = "/quickstart"
  status = 302

[[redirects]]
  # redirect old quickstart basics page
  from = "/319191/quickstart-basics"
  to = "/quickstart/319191/basics"
  status = 302

[[redirects]]
  # redirect old quickstart setup page
  from = "/120918/quickstart-setup"
  to = "/quickstart/120918/setup"
  status = 302

[[redirects]]
  # redirect old quickstart sdk page
  from = "/628381/quickstart-sdk"
  to = "/quickstart/628381/sdk"
  status = 302

[[redirects]]
  # redirect old quickstart first pipeline page
  from = "/593914/quickstart-hello"
  to = "/quickstart/593914/hello"
  status = 302

[[redirects]]
  # redirect old quickstart test page
  from = "/947391/quickstart-test"
  to = "/quickstart/947391/test"
  status = 302

[[redirects]]
  # redirect old quickstart build page
  from = "/349011/quickstart-build"
  to = "/quickstart/349011/build"
  status = 302

[[redirects]]
  # redirect old quickstart publish page
  from = "/730264/quickstart-publish"
  to = "/quickstart/730264/publish"
  status = 302

[[redirects]]
  # redirect old quickstart multi-build page
  from = "/472910/quickstart-build-multi"
  to = "/quickstart/472910/build-multi"
  status = 302

[[redirects]]
  # redirect old quickstart caching page
  from = "/635927/quickstart-caching"
  to = "/quickstart/635927/caching"
  status = 302

[[redirects]]
  # redirect old quickstart dockerfile build page
  from = "/429462/quickstart-build-dockerfile"
  to = "/429462/quickstart-build-dockerfile"
  status = 302

[[redirects]]
  # redirect old quickstart conclusion page
  from = "/481031/quickstart-conclusion"
  to = "/quickstart/481031/conclusion"
  status = 302

[[redirects]]
  # redirect services guide to new URL
  from = "/757394/use-service-containers"
  to = "/757394/use-services"
  status = 302

[[redirects]]
  # redirect temporary zenith labs page to temporary zenith docs
  from = "/labs/project-zenith"
  to = "/zenith"
  status = 301

[[redirects]]
  # redirect v0.1 docs to archive.docs.dagger.io/0.1/
  from = "/0.1/*"
  to = "https://archive.docs.dagger.io/0.1/:splat"
  status = 301

# start: specific redirects for v0.1 docs
[[redirects]]
  from = "/1001/install"
  to = "https://archive.docs.dagger.io/0.1/1001/install"
  status = 301

[[redirects]]
  from = "/1002/vs"
  to = "https://archive.docs.dagger.io/0.1/1002/vs"
  status = 301

[[redirects]]
  from = "/1003/get-started"
  to = "https://archive.docs.dagger.io/0.1/1003/get-started"
  status = 301

[[redirects]]
  from = "/1004/dev-first-env/"
  to = "https://archive.docs.dagger.io/0.1/1004/dev-first-env/"
  status = 301

[[redirects]]
  from = "/1005/what-is-cue"
  to = "https://archive.docs.dagger.io/0.1/1005/what-is-cue"
  status = 301

[[redirects]]
  from = "/1006/google-cloud-run"
  to = "https://archive.docs.dagger.io/0.1/1006/google-cloud-run"
  status = 301

[[redirects]]
  from = "/1007/kubernetes"
  to = "https://archive.docs.dagger.io/0.1/1007/kubernetes"
  status = 301

[[redirects]]
  from = "/1008/aws-cloudformation"
  to = "https://archive.docs.dagger.io/0.1/1008/aws-cloudformation"
  status = 301

[[redirects]]
  from = "/1009/github-actions"
  to = "https://archive.docs.dagger.io/0.1/1009/github-actions"
  status = 301

[[redirects]]
  from = "/1010/dev-cue-package"
  to = "https://archive.docs.dagger.io/0.1/1010/dev-cue-package"
  status = 301

[[redirects]]
  from = "/1011/package-manager"
  to = "https://archive.docs.dagger.io/0.1/1011/package-manager"
  status = 301

[[redirects]]
  # see https://github.com/dagger/dagger/commit/c8e42af05abda5a0e6bf7c485b52208a87dd038e
  from = "/1011/operator-manual"
  to = "https://archive.docs.dagger.io/0.1/1011/operator-manual"
  status = 301

[[redirects]]
  # see https://github.com/dagger/dagger/commit/c8e42af05abda5a0e6bf7c485b52208a87dd038e
  from = "/1013/operator-manual"
  to = "https://archive.docs.dagger.io/0.1/1011/operator-manual"
  status = 301

[[redirects]]
  from = "/1012/ci"
  to = "https://archive.docs.dagger.io/0.1/1012/ci"
  status = 301

[[redirects]]
  from = "/v0.1/reference"
  to = "https://archive.docs.dagger.io/0.1/reference"
  status = 301
# end: specific redirects for v0.1 docs

[[redirects]]
  # redirect v0.2 docs to archive.docs.dagger.io/0.2/
  from = "/0.2/*"
  to = "https://archive.docs.dagger.io/0.2/:splat"
  status = 301

# start: specific redirects for v0.2 docs
[[redirects]]
  from = "/dgr18/overview"
  to = "https://archive.docs.dagger.io/0.2/dgr18/overview"
  status = 301

[[redirects]]
  from = "/1242/install"
  to = "https://archive.docs.dagger.io/0.2/1242/install"
  status = 301

[[redirects]]
  from = "/f44rm/how-it-works"
  to = "https://archive.docs.dagger.io/0.2/f44rm/how-it-works"
  status = 301

[[redirects]]
  from = "/1200/local-dev"
  to = "https://archive.docs.dagger.io/0.2/1200/local-dev"
  status = 301

[[redirects]]
  from = "/1201/ci-environment"
  to = "https://archive.docs.dagger.io/0.2/1201/ci-environment"
  status = 301

[[redirects]]
  from = "/1220/vs"
  to = "https://archive.docs.dagger.io/0.2/1220/vs"
  status = 301

[[redirects]]
  from = "/1221/action"
  to = "https://archive.docs.dagger.io/0.2/1221/action"
  status = 301

[[redirects]]
  from = "/1202/plan"
  to = "https://archive.docs.dagger.io/0.2/1202/plan"
  status = 301

[[redirects]]
  from = "/1203/client"
  to = "https://archive.docs.dagger.io/0.2/1203/client"
  status = 301

[[redirects]]
  from = "/1204/secrets"
  to = "https://archive.docs.dagger.io/0.2/1204/secrets"
  status = 301

[[redirects]]
  from = "/1206/packages"
  to = "https://archive.docs.dagger.io/0.2/1206/packages"
  status = 301

[[redirects]]
  from = "/1207/caching"
  to = "https://archive.docs.dagger.io/0.2/1207/caching"
  status = 301

[[redirects]]
  from = "/1213/api"
  to = "https://archive.docs.dagger.io/0.2/1213/api"
  status = 301

[[redirects]]
  from = "/1215/what-is-cue/"
  to = "https://archive.docs.dagger.io/0.2/1215/what-is-cue/"
  status = 301

[[redirects]]
  from = "/1247/dagger-fs"
  to = "https://archive.docs.dagger.io/0.2/1247/dagger-fs"
  status = 301

[[redirects]]
  from = "/1228/handling-outputs"
  to = "https://archive.docs.dagger.io/0.2/1228/handling-outputs"
  status = 301

[[redirects]]
  from = "/1231/always-execute"
  to = "https://archive.docs.dagger.io/0.2/1231/always-execute"
  status = 301

[[redirects]]
  from = "/1233/default-values-cue"
  to = "https://archive.docs.dagger.io/0.2/1233/default-values-cue"
  status = 301

[[redirects]]
  from = "/1239/making-reusable-package"
  to = "https://archive.docs.dagger.io/0.2/1239/making-reusable-package"
  status = 301

[[redirects]]
  from = "/1240/core-source"
  to = "https://archive.docs.dagger.io/0.2/1240/core-source"
  status = 301

[[redirects]]
  from = "/1241/field-shadowing"
  to = "https://archive.docs.dagger.io/0.2/1241/field-shadowing"
  status = 301

[[redirects]]
  from = "/1223/custom-buildkit/"
  to = "https://archive.docs.dagger.io/0.2/1223/custom-buildkit/"
  status = 301

[[redirects]]
  from = "/1224/self-signed-certificates/"
  to = "https://archive.docs.dagger.io/0.2/1224/self-signed-certificates/"
  status = 301

[[redirects]]
  from = "/1229/empty-buildkit-cache"
  to = "https://archive.docs.dagger.io/0.2/1229/empty-buildkit-cache"
  status = 301

[[redirects]]
  from = "/1237/persistent-cache-with-dagger"
  to = "https://archive.docs.dagger.io/0.2/1237/persistent-cache-with-dagger"
  status = 301

[[redirects]]
  from = "/1230/better-logs"
  to = "https://archive.docs.dagger.io/0.2/1230/better-logs"
  status = 301

[[redirects]]
  from = "/1243/dagger-cloud"
  to = "https://archive.docs.dagger.io/0.2/1243/dagger-cloud"
  status = 301

[[redirects]]
  from = "/1205/container-images"
  to = "https://archive.docs.dagger.io/0.2/1205/container-images"
  status = 301

[[redirects]]
  from = "/1225/pushing-plan-dependencies/"
  to = "https://archive.docs.dagger.io/0.2/1225/pushing-plan-dependencies/"
  status = 301

[[redirects]]
  from = "/1232/chain-actions"
  to = "https://archive.docs.dagger.io/0.2/1232/chain-actions"
  status = 301

[[redirects]]
  from = "/1238/project-file-organization"
  to = "https://archive.docs.dagger.io/0.2/1238/project-file-organization"
  status = 301

[[redirects]]
  from = "/1244/docker"
  to = "https://archive.docs.dagger.io/0.2/1244/docker"
  status = 301

[[redirects]]
  from = "/1246/go-ci"
  to = "https://archive.docs.dagger.io/0.2/1246/go-ci"
  status = 301

[[redirects]]
  from = "/4dhu9/api-customizable-image"
  to = "https://archive.docs.dagger.io/0.2/4dhu9/api-customizable-image"
  status = 301

[[redirects]]
  from = "/1216/docker-cli-load"
  to = "https://archive.docs.dagger.io/0.2/1216/docker-cli-load"
  status = 301

[[redirects]]
  from = "/1217/docker-cli-run"
  to = "https://archive.docs.dagger.io/0.2/1217/docker-cli-run"
  status = 301

[[redirects]]
  from = "/1214/migrate-from-dagger-0.1"
  to = "https://archive.docs.dagger.io/0.2/1214/migrate-from-dagger-0.1"
  status = 301

[[redirects]]
  from = "/1218/cli-telemetry"
  to = "https://archive.docs.dagger.io/0.2/1218/cli-telemetry"
  status = 301

[[redirects]]
  from = "/1227/contributing"
  to = "https://archive.docs.dagger.io/0.2/1227/contributing"
  status = 301

[[redirects]]
  from = "/1226/coding-style"
  to = "https://archive.docs.dagger.io/0.2/1226/coding-style"
  status = 301

[[redirects]]
  from = "/1222/core-actions-reference"
  to = "https://archive.docs.dagger.io/0.2/1222/core-actions-reference"
  status = 301

[[redirects]]
  from = "/1234/dagger-types-reference"
  to = "https://archive.docs.dagger.io/0.2/1234/dagger-types-reference"
  status = 301

[[redirects]]
  from = "/13ec8/dagger-env-reference"
  to = "https://archive.docs.dagger.io/0.2/13ec8/dagger-env-reference"
  status = 301

[[redirects]]
  from = "/category/use-cases"
  to = "https://archive.docs.dagger.io/0.2/category/use-cases"
  status = 301

[[redirects]]
  from = "/1211/go-docker-swarm"
  to = "https://archive.docs.dagger.io/0.2/1211/go-docker-swarm"
  status = 301

[[redirects]]
  from = "/1219/go-docker-hub"
  to = "https://archive.docs.dagger.io/0.2/1219/go-docker-hub"
  status = 301

[[redirects]]
  from = "/1245/node-ci"
  to = "https://archive.docs.dagger.io/0.2/1245/node-ci"
  status = 301

[[redirects]]
  from = "/1248/aws-sam"
  to = "https://archive.docs.dagger.io/0.2/1248/aws-sam"
  status = 301
# end: specific redirects for v0.2 docs

# redirect to the playground's embed to maintain same origin
# see https://github.com/dagger/dagger/pull/4753
[[redirects]]
  from = "/embed/*"
  to = "https://play.dagger.cloud/embed/:splat"
  status = 200

# redirect to the playground's Next.js build artifacts
[[redirects]]
  from = "/_next/*"
  to = "https://play.dagger.cloud/_next/:splat"
  status = 200

[[redirects]]
  from = "/current/sdk/nodejs/*"
  to = "/sdk/nodejs/:splat"
  status = 302

[[headers]]
  for = "/*"
  [headers.values]
  Referrer-policy = "no-referrer-when-downgrade"
