From d7050f09e4f0b3ff44669817e9c0ecbe3d73b0ac Mon Sep 17 00:00:00 2001 From: Taras <9948629+taraspos@users.noreply.github.com> Date: Tue, 27 May 2025 17:49:00 +0100 Subject: [PATCH 1/3] Try caching teleport code --- amplify.yml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 amplify.yml diff --git a/amplify.yml b/amplify.yml new file mode 100644 index 0000000..ea64bce --- /dev/null +++ b/amplify.yml @@ -0,0 +1,35 @@ +version: 1 +frontend: + phases: + preBuild: + commands: + # Setup Swapfile to work around lack of RAM on build node + # https://github.com/aws-amplify/amplify-hosting/issues/654 + - echo "Setting up swap space..." + - sudo fallocate -l 40G ../swapfile + - sudo chmod 600 ../swapfile + - sudo mkswap ../swapfile + - sudo swapon ../swapfile + - sudo swapon -s + - echo "✅ Done setting up swap space!" + # install yarn dependencies + - yarn + - echo "Setting up content cache" + - | + if [ -d ./cached_content ]; then + rm -rf content/ + else + mv content/ cached_content/ + fi + - ln -s cached_content/ content/ + build: + commands: + - yarn build --out-dir build/${local.teleport_docs_subpath} + artifacts: + baseDirectory: build + files: + - '**/*' + cache: + paths: + - node_modules/**/* + - cached_content/**/* From 1f0ad3063a63ca4c2d7e6ef6bf3df90121b7342a Mon Sep 17 00:00:00 2001 From: Taras <9948629+taraspos@users.noreply.github.com> Date: Tue, 27 May 2025 17:49:38 +0100 Subject: [PATCH 2/3] Update amplify.yml --- amplify.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/amplify.yml b/amplify.yml index ea64bce..a9207c9 100644 --- a/amplify.yml +++ b/amplify.yml @@ -24,7 +24,7 @@ frontend: - ln -s cached_content/ content/ build: commands: - - yarn build --out-dir build/${local.teleport_docs_subpath} + - yarn build --out-dir build/docs/ artifacts: baseDirectory: build files: From 62c55448a1e511d7dcd934c83dff0bc32b3c05bb Mon Sep 17 00:00:00 2001 From: Taras <9948629+taraspos@users.noreply.github.com> Date: Tue, 27 May 2025 18:04:06 +0100 Subject: [PATCH 3/3] Update amplify.yml --- amplify.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/amplify.yml b/amplify.yml index a9207c9..3b80b85 100644 --- a/amplify.yml +++ b/amplify.yml @@ -21,7 +21,7 @@ frontend: else mv content/ cached_content/ fi - - ln -s cached_content/ content/ + - ln -s cached_content/ content build: commands: - yarn build --out-dir build/docs/