Improve docker build (#24692)
* better caching, reduce context size, etc
This commit is contained in:
11
.github/actions-scripts/merge-early-access.sh
vendored
Executable file
11
.github/actions-scripts/merge-early-access.sh
vendored
Executable 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
|
||||
24
.github/actions-scripts/prune-for-preview-env.sh
vendored
Executable file
24
.github/actions-scripts/prune-for-preview-env.sh
vendored
Executable 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
|
||||
Reference in New Issue
Block a user