1
0
mirror of synced 2025-12-30 03:01:36 -05:00

Improve docker build (#24692)

* better caching, reduce context size, etc
This commit is contained in:
Mike Surowiec
2022-02-02 15:05:20 -06:00
committed by GitHub
parent 4ede312204
commit 59b53a9300
8 changed files with 140 additions and 43 deletions

11
.github/actions-scripts/merge-early-access.sh vendored Executable file
View File

@@ -0,0 +1,11 @@
#!/usr/bin/env bash
# [start-readme]
#
# This script takes docs-early-access files and merges them into docs-internal
#
# [end-readme]
mv docs-early-access/assets assets/images/early-access
mv docs-early-access/content content/early-access
mv docs-early-access/data data/early-access

View File

@@ -0,0 +1,24 @@
#!/usr/bin/env bash
# [start-readme]
#
# This script removes files that are unnecessary for our preview environments.
# This is typically run before a docker build to reduce the size of the build context sent to docker
#
# [end-readme]
# Remove all but the english search indexes
find lib/search/indexes ! -name '*-en.json.br' ! -name '*-en-records.json.br' -maxdepth 1 -type f -delete
# Translations are never tested in preview environments
# but let's keep the empty directory.
rm -rf translations
mkdir translations
# The assumption here is that a preview build will not
# need these legacy redirects. Only the redirects from
# front-matter will be at play.
# These static redirects json files are notoriously large
echo '[]' > lib/redirects/static/archived-frontmatter-fallbacks.json
echo '{}' > lib/redirects/static/developer.json
echo '{}' > lib/redirects/static/archived-redirects-from-213-to-217.json