From 3b5449d410b7b0022be0940db7b5a94d00b3ff57 Mon Sep 17 00:00:00 2001 From: ludamad Date: Sat, 18 Nov 2023 11:50:22 +0000 Subject: [PATCH] deploy pipeline for docs --- .circleci/config.yml | 12 +++++++++--- build_manifest.yml | 1 + docs/Dockerfile | 5 +---- docs/Dockerfile.dockerignore | 1 + docs/deploy_netlify.sh | 9 +++++++++ 5 files changed, 21 insertions(+), 7 deletions(-) create mode 100755 docs/deploy_netlify.sh diff --git a/.circleci/config.yml b/.circleci/config.yml index 35b9bdee375d..99a931712776 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -922,12 +922,18 @@ jobs: steps: - *checkout - *setup_env - - run: - name: "Copy docs dockerignore" - command: cp docs/.dockerignore . - 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/build_manifest.yml b/build_manifest.yml index c8ef6d2c53fb..13f552ab6c9b 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/Dockerfile b/docs/Dockerfile index cf824308a2d5..847379f1ccfd 100644 --- a/docs/Dockerfile +++ b/docs/Dockerfile @@ -2,7 +2,4 @@ FROM 278380418400.dkr.ecr.eu-west-2.amazonaws.com/yarn-project WORKDIR /usr/src COPY . . WORKDIR /usr/src/docs -RUN ls node_modules >&2 && false -RUN npm install netlify-cli -g -RUN yarn && yarn build -RUN netlify deploy \ No newline at end of file +RUN yarn && yarn build \ No newline at end of file diff --git a/docs/Dockerfile.dockerignore b/docs/Dockerfile.dockerignore index 252d60d6c83d..df9590e92941 100644 --- a/docs/Dockerfile.dockerignore +++ b/docs/Dockerfile.dockerignore @@ -10,6 +10,7 @@ **/processed-docs-cache # rebuild patterns !**/*.cpp +!**/*.hpp !**/*.ts !**/.release-please-manifest.json !**/noir-version.json diff --git a/docs/deploy_netlify.sh b/docs/deploy_netlify.sh new file mode 100755 index 000000000000..3fe345519582 --- /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 . +cd usr/src/docs +npm install netlify-cli -g +netlify deploy +netlify deploy --prod \ No newline at end of file