Skip to content

Commit

Permalink
[ci] use GitHub Actions to build documentation site
Browse files Browse the repository at this point in the history
Signed-off-by: Gary Guo <[email protected]>
(cherry picked from commit 26f1bff)
  • Loading branch information
nbdd0121 authored and jwnrt committed Dec 13, 2024
1 parent f2534c6 commit 920a93b
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 64 deletions.
29 changes: 28 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ jobs:
name: Build documentation
runs-on: ubuntu-22.04
needs: quick_lint
env:
BUCKET: gold-hybrid-255313-prod
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -134,7 +136,32 @@ jobs:
with:
service_account_json: '${{ secrets.BAZEL_CACHE_CREDS }}'
- name: Build documentation
run: ./ci/scripts/build-docs.sh
run: util/site/build-docs.sh build
- name: Upload files
if: ${{ github.event_name != 'pull_request' && github.ref_name == 'earlgrey_1.0.0' }}
run: |
echo "::group::Upload all uncompressed files"
gcloud storage cp -R --gzip-in-flight=js,css,html "build-site/*" gs://$BUCKET/earlgrey_1.0.0
echo "::endgroup::"
# This script compresses the searchindex files, replacing the originals in-place.
# (This is how 'content-encoding'-tagged files should be uploaded to gcloud buckets)
util/site/post-build.sh compress_br
search_indexes=$(find build-site/ -type f -name '*searchindex.json')
for f in $search_indexes; do
echo "Uploading compressed file ${f}"
# Get directory of file, relative to the build directory.
# - var=${var#*//} # removes stuff from the begining up to //
dir=$(dirname "${f#*build-site/}")
# When serving from gcloud buckets, file should be uploaded with an identical name as the
# original, but compressed and with the matching 'content-encoding' and 'content-type' tags applied.
gcloud storage cp \
--content-encoding=br \
--content-type=application/json \
-R \
"$f" "gs://$BUCKET/earlgrey_1.0.0/${dir}/"
done
airgapped_build:
name: Airgapped build
Expand Down
7 changes: 0 additions & 7 deletions util/site/site-builder/README.md

This file was deleted.

56 changes: 0 additions & 56 deletions util/site/site-builder/cloudbuild-deploy-docs.yaml

This file was deleted.

0 comments on commit 920a93b

Please sign in to comment.