docker-mailserver.docker-ma.../.github/workflows/scripts/docs/build-docs.sh
Brennan Kinney 6b4627ceab
ci(docs-preview): Refactor workflows (#4262)
**Overview of changes:**
- Runner bumped from Ubuntu 22.04 => 24.04
- Revised inline documentation for maintainers.
- The output of `build-docs.sh` is now grouped in the steps action log, and now hides the noise from pulling the image via `docker run`.
- Removed the separate `tar` steps with ZSTD as there is only a directory to archive with recent changes to this workflow. The `upload` + `download` actions are sufficient.
- The `workflow_run` job has had the PR context restore step extracted to a separate job to minimize noise.
- `actions-netlify` is still effectively the same functionality.
  - `github-token` is no longer configured as it doesn't appear needed with the functions disabled.
  - Opt-out of the GH deployments feature which is not needed.
2024-11-15 13:00:40 +13:00

22 lines
726 B
Bash
Executable file

#!/bin/bash
set -ex
# PWD should be at the project docs/ folder.
# `--user` is required for build output file ownership to match the CI user,
# instead of the internal root user of the container.
# `build --strict` ensures the build fails when any warnings are omitted.
docker run \
--rm \
--quiet \
--user "$(id -u):$(id -g)" \
--volume "./:/docs" \
--name "build-docs" \
squidfunk/mkdocs-material:9.5 build --strict
# Remove unnecessary build artifacts: https://github.com/squidfunk/mkdocs-material/issues/2519
# site/ is the build output folder.
cd site
find . -type f -name '*.min.js.map' -delete -o -name '*.min.css.map' -delete
rm sitemap.xml.gz
rm assets/images/favicon.png
rm -r assets/javascripts/lunr