1
0
mirror of synced 2025-12-30 03:01:36 -05:00
Files
docs/.github/actions-scripts/prune-for-preview-env.sh
Peter Bengtsson 2ebfb60b4b refactor how archived frontmatter fallbacks work (#28170)
* refactor how archived frontmatter fallbacks work

* delete no-longer used file

* avoid the mention

* Update lib/redirects/README.md

Co-authored-by: Sarah Schneider <sarahs@users.noreply.github.com>

Co-authored-by: Sarah Schneider <sarahs@users.noreply.github.com>
2022-07-12 20:23:05 +00:00

24 lines
866 B
Bash
Executable File

#!/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-valid-urls.json
echo '{}' > lib/redirects/static/archived-redirects-from-213-to-217.json