From 624d7339d6bd9755156487a07c553b00f92c3b4b Mon Sep 17 00:00:00 2001 From: ludamad Date: Sat, 18 Nov 2023 17:20:59 +0300 Subject: [PATCH] feat: deploy docs from CCI w/ netlify-cli (#3348) We're just going to accept that docs reflect the entire monorepo, because: - needs to make snippets from live code, we don't want that code living anywhere special, just doc directives where the code lies - we want to run tsdoc, that needs ~everything because of codegen, typescript running etc And netlify CI isn't really meant for this level of complexity. We use netlify-cli instead. --------- Co-authored-by: ludamad --- .circleci/config.yml | 9 +++++++++ .gitignore | 3 +++ build_manifest.yml | 1 + docs/.dockerignore | 2 +- docs/Dockerfile.dockerignore | 1 + docs/deploy_netlify.sh | 9 +++++++++ 6 files changed, 24 insertions(+), 1 deletion(-) create mode 100755 docs/deploy_netlify.sh diff --git a/.circleci/config.yml b/.circleci/config.yml index 35b9bdee375..e6b88d71d4e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -928,6 +928,15 @@ jobs: - run: name: "Build docs" command: build docs + - run: + name: "Deploy docs" + command: | + if [ "$CIRCLE_BRANCH" == "master" ]; then + echo "Deploying docs (on master)." + docs/deploy_netlify.sh + else + echo "Skipping doc deploy (not on master)." + fi e2e-join: docker: diff --git a/.gitignore b/.gitignore index 46c867ea481..1a18b0f2f7d 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,6 @@ build/ cmake-build-debug .terraform* .bootstrapped + +# Local Netlify folder +.netlify diff --git a/build_manifest.yml b/build_manifest.yml index c8ef6d2c53f..13f552ab6c9 100644 --- a/build_manifest.yml +++ b/build_manifest.yml @@ -173,6 +173,7 @@ docs: rebuildPatterns: - ^docs/ - ^.*.cpp$ + - ^.*.hpp$ - ^.*.ts$ - ^.release-please-manifest.json$ - ^.*/noir-version.json$ diff --git a/docs/.dockerignore b/docs/.dockerignore index 61e5039c958..e9573dbf7ff 100644 --- a/docs/.dockerignore +++ b/docs/.dockerignore @@ -1,4 +1,4 @@ -*.node_modules +**/node_modules *.docusaurus *.processed-docs *.processed-docs-cache diff --git a/docs/Dockerfile.dockerignore b/docs/Dockerfile.dockerignore index 224a414b0af..081dd23cc74 100644 --- a/docs/Dockerfile.dockerignore +++ b/docs/Dockerfile.dockerignore @@ -3,6 +3,7 @@ * !docs +docs/node_modules !l1-contracts/src !l1-contracts/test !barretenberg/cpp/src/barretenberg diff --git a/docs/deploy_netlify.sh b/docs/deploy_netlify.sh new file mode 100755 index 00000000000..82b447119f6 --- /dev/null +++ b/docs/deploy_netlify.sh @@ -0,0 +1,9 @@ +#!/bin/bash +[ -n "${BUILD_SYSTEM_DEBUG:-}" ] && set -x # conditionally trace +set -eu + +extract_repo docs /usr/src extracted-repo +cd extracted-repo/src/docs +npm install netlify-cli -g +netlify deploy --site aztec-docs-dev +netlify deploy --site aztec-docs-dev --prod \ No newline at end of file