Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
185 changes: 183 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,13 +147,30 @@ jobs:
- name: List files to be published
run: ls "${{ github.workspace }}/public"

# Packaged here rather than in the deploy job so the archives travel as their
# own artifact instead of bloating build-latest. This build has no versioned
# content, so it covers every unversioned product plus the current release of
# the versioned ones; the matrix jobs below add the archived versions.
- name: Package download bundles
run: |
python3 build/make_doc_bundles.py \
--source public --out bundles \
--url-base "https://redis.io/${{ needs.discover_versions.outputs.hugo_root_path }}/"

- name: Upload latest artifact
uses: actions/upload-artifact@v4
with:
name: build-latest
path: public/
retention-days: 1

- name: Upload download bundles
uses: actions/upload-artifact@v4
with:
name: bundles-latest
path: bundles/
retention-days: 1

# Build Kubernetes versions in parallel
build_kubernetes:
name: Build Kubernetes ${{ matrix.version }}
Expand Down Expand Up @@ -229,13 +246,27 @@ jobs:
--subtree "operate/kubernetes/${version}" \
--output "output/operate/kubernetes/${version}/sitemap.xml"

- name: Package download bundles for Kubernetes ${{ matrix.version }}
run: |
python3 build/make_doc_bundles.py \
--source output --out bundles \
--only redis-kubernetes --version "${{ matrix.version }}" \
--url-base "https://redis.io/${{ needs.discover_versions.outputs.hugo_root_path }}/"

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: build-kubernetes-${{ matrix.version }}
path: output/
retention-days: 1

- name: Upload download bundles
uses: actions/upload-artifact@v4
with:
name: bundles-kubernetes-${{ matrix.version }}
path: bundles/
retention-days: 1

# Uploaded separately as well so deploy_version_sitemaps can collect every
# version's sitemap without downloading four dozen full site builds.
- name: Upload Kubernetes ${{ matrix.version }} sitemap
Expand Down Expand Up @@ -316,13 +347,27 @@ jobs:
--subtree "operate/rs/${version}" \
--output "output/operate/rs/${version}/sitemap.xml"

- name: Package download bundles for RS ${{ matrix.version }}
run: |
python3 build/make_doc_bundles.py \
--source output --out bundles \
--only redis-software --version "${{ matrix.version }}" \
--url-base "https://redis.io/${{ needs.discover_versions.outputs.hugo_root_path }}/"

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: build-rs-${{ matrix.version }}
path: output/
retention-days: 1

- name: Upload download bundles
uses: actions/upload-artifact@v4
with:
name: bundles-rs-${{ matrix.version }}
path: bundles/
retention-days: 1

- name: Upload RS ${{ matrix.version }} sitemap
uses: actions/upload-artifact@v4
with:
Expand Down Expand Up @@ -401,13 +446,27 @@ jobs:
--subtree "integrate/redis-data-integration/${version}" \
--output "output/integrate/redis-data-integration/${version}/sitemap.xml"

- name: Package download bundles for RDI ${{ matrix.version }}
run: |
python3 build/make_doc_bundles.py \
--source output --out bundles \
--only redis-data-integration --version "${{ matrix.version }}" \
--url-base "https://redis.io/${{ needs.discover_versions.outputs.hugo_root_path }}/"

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: build-rdi-${{ matrix.version }}
path: output/
retention-days: 1

- name: Upload download bundles
uses: actions/upload-artifact@v4
with:
name: bundles-rdi-${{ matrix.version }}
path: bundles/
retention-days: 1

- name: Upload RDI ${{ matrix.version }} sitemap
uses: actions/upload-artifact@v4
with:
Expand Down Expand Up @@ -486,13 +545,27 @@ jobs:
--subtree "develop/ai/redisvl/${version}" \
--output "output/develop/ai/redisvl/${version}/sitemap.xml"

- name: Package download bundles for RedisVL ${{ matrix.version }}
run: |
python3 build/make_doc_bundles.py \
--source output --out bundles \
--only redisvl --version "${{ matrix.version }}" \
--url-base "https://redis.io/${{ needs.discover_versions.outputs.hugo_root_path }}/"

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: build-redisvl-${{ matrix.version }}
path: output/
retention-days: 1

- name: Upload download bundles
uses: actions/upload-artifact@v4
with:
name: bundles-redisvl-${{ matrix.version }}
path: bundles/
retention-days: 1

- name: Upload RedisVL ${{ matrix.version }} sitemap
uses: actions/upload-artifact@v4
with:
Expand Down Expand Up @@ -522,6 +595,12 @@ jobs:
name: build-latest
path: public/

- name: Download download bundles
uses: actions/download-artifact@v4
with:
name: bundles-latest
path: bundles/

- name: 'Google auth'
uses: 'google-github-actions/auth@v2'
with:
Expand Down Expand Up @@ -554,12 +633,29 @@ jobs:
done
}

# Download bundles for /docs/downloads/. gsutil guesses
# "Content-Encoding: gzip" from the .tar.gz extension, which would make
# browsers inflate the archive on the way in and save a plain tar under a
# .tar.gz name. Pin the content type on upload so there is nothing to
# guess, then clear any encoding that slipped through anyway (a header
# with no value removes it).
upload_bundles() {
local dest="$1/downloads/bundles"
gsutil -m -h "Content-Type:application/gzip" -h "Cache-Control:public, max-age=600" \
cp bundles/*.tar.gz "$dest/"
gsutil -m cp bundles/*.json "$dest/"
gsutil -m setmeta -h "Content-Encoding" "$dest/*.tar.gz" \
|| echo "::warning::could not clear Content-Encoding on $dest"
}

# The two destinations are independent, so run their sync pipelines
# concurrently. Within each destination the destructive sync still runs
# before the additive css/scss upload.
# before the additive css/scss upload. The bundles are excluded from the
# mirror because the versioned deploy jobs write their archives into the
# same directory and this job does not have them -- `-d` would delete them.
sync_dest() {
local dest="$1"
gsutil -m rsync -r -c -j html -d -x '^(css|scss)/' public "$dest"
gsutil -m rsync -r -c -j html -d -x '^(css|scss)/|^downloads/bundles/' public "$dest"
upload_assets "$dest"
}

Expand All @@ -572,6 +668,11 @@ jobs:
wait "$pid_root"
wait "$pid_docs"

# Only under docs/, which is where the versioned deploy jobs add their own
# archives and where the picker page resolves its links from (baseURL
# already carries the docs/ prefix).
upload_bundles "gs://$BUCKET/docs/$bucket_path"

# Deploy Kubernetes versions to GCS
deploy_kubernetes:
name: Deploy Kubernetes ${{ matrix.version }}
Expand Down Expand Up @@ -605,6 +706,12 @@ jobs:
name: build-kubernetes-${{ matrix.version }}
path: output/

- name: Download download bundles
uses: actions/download-artifact@v4
with:
name: bundles-kubernetes-${{ matrix.version }}
path: bundles/

- name: 'Google auth'
uses: 'google-github-actions/auth@v2'
with:
Expand Down Expand Up @@ -637,14 +744,28 @@ jobs:
done
}

# This version's download bundles join the ones deploy_latest uploaded
# into the same directory. See deploy_latest for why the object metadata
# is pinned by hand.
upload_bundles() {
local dest="$1/downloads/bundles"
gsutil -m -h "Content-Type:application/gzip" -h "Cache-Control:public, max-age=600" \
cp bundles/*.tar.gz "$dest/"
gsutil -m cp bundles/*.json "$dest/"
gsutil -m setmeta -h "Content-Encoding" "$dest/*.tar.gz" \
|| echo "::warning::could not clear Content-Encoding on $dest"
}

if [[ "$bucket_path" == "latest" ]]; then
gsutil -m rsync -r -c -j html -d output/operate/kubernetes "gs://${BUCKET}/kubernetes-${version}/operate/kubernetes"
gsutil -m rsync -r -c -j html -d "output/operate/kubernetes/${version}" "gs://${BUCKET}/docs/${bucket_path}/operate/kubernetes/${version}"
upload_assets "gs://${BUCKET}/docs/${bucket_path}"
upload_bundles "gs://${BUCKET}/docs/${bucket_path}"
elif [[ "$bucket_path" == staging/* ]]; then
gsutil -m rsync -r -c -j html -d output/operate/kubernetes "gs://${BUCKET}/${bucket_path}/kubernetes-${version}/operate/kubernetes"
gsutil -m rsync -r -c -j html -d "output/operate/kubernetes/${version}" "gs://${BUCKET}/docs/${bucket_path}/operate/kubernetes/${version}"
upload_assets "gs://${BUCKET}/docs/${bucket_path}"
upload_bundles "gs://${BUCKET}/docs/${bucket_path}"
fi

# Deploy RS versions to GCS
Expand Down Expand Up @@ -678,6 +799,12 @@ jobs:
name: build-rs-${{ matrix.version }}
path: output/

- name: Download download bundles
uses: actions/download-artifact@v4
with:
name: bundles-rs-${{ matrix.version }}
path: bundles/

- name: 'Google auth'
uses: 'google-github-actions/auth@v2'
with:
Expand Down Expand Up @@ -705,14 +832,28 @@ jobs:
done
}

# This version's download bundles join the ones deploy_latest uploaded
# into the same directory. See deploy_latest for why the object metadata
# is pinned by hand.
upload_bundles() {
local dest="$1/downloads/bundles"
gsutil -m -h "Content-Type:application/gzip" -h "Cache-Control:public, max-age=600" \
cp bundles/*.tar.gz "$dest/"
gsutil -m cp bundles/*.json "$dest/"
gsutil -m setmeta -h "Content-Encoding" "$dest/*.tar.gz" \
|| echo "::warning::could not clear Content-Encoding on $dest"
}

if [[ "$bucket_path" == "latest" ]]; then
gsutil -m rsync -r -c -j html -d output/operate/rs "gs://${BUCKET}/rs-${version}/operate/rs"
gsutil -m rsync -r -c -j html -d "output/operate/rs/${version}" "gs://${BUCKET}/docs/${bucket_path}/operate/rs/${version}"
upload_assets "gs://${BUCKET}/docs/${bucket_path}"
upload_bundles "gs://${BUCKET}/docs/${bucket_path}"
elif [[ "$bucket_path" == staging/* ]]; then
gsutil -m rsync -r -c -j html -d output/operate/rs "gs://${BUCKET}/${bucket_path}/rs-${version}/operate/rs"
gsutil -m rsync -r -c -j html -d "output/operate/rs/${version}" "gs://${BUCKET}/docs/${bucket_path}/operate/rs/${version}"
upload_assets "gs://${BUCKET}/docs/${bucket_path}"
upload_bundles "gs://${BUCKET}/docs/${bucket_path}"
fi

# Deploy RDI versions to GCS
Expand Down Expand Up @@ -746,6 +887,12 @@ jobs:
name: build-rdi-${{ matrix.version }}
path: output/

- name: Download download bundles
uses: actions/download-artifact@v4
with:
name: bundles-rdi-${{ matrix.version }}
path: bundles/

- name: 'Google auth'
uses: 'google-github-actions/auth@v2'
with:
Expand Down Expand Up @@ -773,14 +920,28 @@ jobs:
done
}

# This version's download bundles join the ones deploy_latest uploaded
# into the same directory. See deploy_latest for why the object metadata
# is pinned by hand.
upload_bundles() {
local dest="$1/downloads/bundles"
gsutil -m -h "Content-Type:application/gzip" -h "Cache-Control:public, max-age=600" \
cp bundles/*.tar.gz "$dest/"
gsutil -m cp bundles/*.json "$dest/"
gsutil -m setmeta -h "Content-Encoding" "$dest/*.tar.gz" \
|| echo "::warning::could not clear Content-Encoding on $dest"
}

if [[ "$bucket_path" == "latest" ]]; then
gsutil -m rsync -r -c -j html -d output/integrate/redis-data-integration "gs://${BUCKET}/redis-data-integration-${version}/integrate/redis-data-integration"
gsutil -m rsync -r -c -j html -d "output/integrate/redis-data-integration/${version}" "gs://${BUCKET}/docs/${bucket_path}/integrate/redis-data-integration/${version}"
upload_assets "gs://${BUCKET}/docs/${bucket_path}"
upload_bundles "gs://${BUCKET}/docs/${bucket_path}"
elif [[ "$bucket_path" == staging/* ]]; then
gsutil -m rsync -r -c -j html -d output/integrate/redis-data-integration "gs://${BUCKET}/${bucket_path}/redis-data-integration-${version}/integrate/redis-data-integration"
gsutil -m rsync -r -c -j html -d "output/integrate/redis-data-integration/${version}" "gs://${BUCKET}/docs/${bucket_path}/integrate/redis-data-integration/${version}"
upload_assets "gs://${BUCKET}/docs/${bucket_path}"
upload_bundles "gs://${BUCKET}/docs/${bucket_path}"
fi

# Deploy RedisVL versions to GCS
Expand Down Expand Up @@ -814,6 +975,12 @@ jobs:
name: build-redisvl-${{ matrix.version }}
path: output/

- name: Download download bundles
uses: actions/download-artifact@v4
with:
name: bundles-redisvl-${{ matrix.version }}
path: bundles/

- name: 'Google auth'
uses: 'google-github-actions/auth@v2'
with:
Expand Down Expand Up @@ -841,14 +1008,28 @@ jobs:
done
}

# This version's download bundles join the ones deploy_latest uploaded
# into the same directory. See deploy_latest for why the object metadata
# is pinned by hand.
upload_bundles() {
local dest="$1/downloads/bundles"
gsutil -m -h "Content-Type:application/gzip" -h "Cache-Control:public, max-age=600" \
cp bundles/*.tar.gz "$dest/"
gsutil -m cp bundles/*.json "$dest/"
gsutil -m setmeta -h "Content-Encoding" "$dest/*.tar.gz" \
|| echo "::warning::could not clear Content-Encoding on $dest"
}

if [[ "$bucket_path" == "latest" ]]; then
gsutil -m rsync -r -c -j html -d output/develop/ai/redisvl "gs://${BUCKET}/redisvl-${version}/develop/ai/redisvl"
gsutil -m rsync -r -c -j html -d "output/develop/ai/redisvl/${version}" "gs://${BUCKET}/docs/${bucket_path}/develop/ai/redisvl/${version}"
upload_assets "gs://${BUCKET}/docs/${bucket_path}"
upload_bundles "gs://${BUCKET}/docs/${bucket_path}"
elif [[ "$bucket_path" == staging/* ]]; then
gsutil -m rsync -r -c -j html -d output/develop/ai/redisvl "gs://${BUCKET}/${bucket_path}/redisvl-${version}/develop/ai/redisvl"
gsutil -m rsync -r -c -j html -d "output/develop/ai/redisvl/${version}" "gs://${BUCKET}/docs/${bucket_path}/develop/ai/redisvl/${version}"
upload_assets "gs://${BUCKET}/docs/${bucket_path}"
upload_bundles "gs://${BUCKET}/docs/${bucket_path}"
fi

# Deploy custom 404 page (only for the production latest build)
Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ package-lock.json
/content/develop/use-cases/**/ruby/.gems/
/content/develop/use-cases/**/ruby/Gemfile.lock

# Documentation download bundles (make bundles / build_docs workflow), and the
# copy `make serve_downloads` drops into static/ so hugo serve can serve them
/bundles/
/static/downloads/

# Link checker (link_check workflow) working files
/external-urls.txt
/.lycheecache
Expand Down
Loading
Loading