Skip to content

Commit

Permalink
Add ability to publish family providers for provider-updoc workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
turkenf committed Sep 15, 2023
1 parent e7a4ea0 commit 6aee415
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions .github/workflows/provider-updoc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,19 @@ name: Updoc

on:
workflow_call:
inputs:
subpackages:
description: "Subpackages to be published individually (e.g. monolith config ec2)"
default: "monolith"
required: false
type: string
secrets:
UPBOUND_CI_PROD_BUCKET_SA:
required: true

env:
GO_VERSION: '1.19'
UPTEST_VERSION: '83bd901'
GO_VERSION: "1.19"
UPTEST_VERSION: "83bd901"

jobs:
publish-docs:
Expand Down Expand Up @@ -53,10 +59,19 @@ jobs:
GOOGLE_APPLICATION_CREDENTIALS: sa.json
PROVIDER_NAME: ${GITHUB_REPOSITORY#*/}
VER_MAJOR_MINOR: v${GITHUB_REF#"refs/heads/release-"}
SUBPACKAGES: ${{ inputs.subpackages }}
run: |
if [[ "${GITHUB_REF##*/}" == release-* ]]; then
echo "Publishing Docs for ${{ env.PROVIDER_NAME }}, ${{ env.VER_MAJOR_MINOR }}"
go run github.com/upbound/uptest/cmd/updoc@${{ env.UPTEST_VERSION }} upload --docs-dir=./docs --name=${{ env.PROVIDER_NAME }} --version=${{ env.VER_MAJOR_MINOR }} --bucket-name=bucket-marketplace-docs-production --cdn-domain=https://user-content.upbound.io
for s in $SUBPACKAGES; do
FAMILY_PROVIDER_NAME="${{ env.PROVIDER_NAME }}-$s"
DOCS_DIR="./docs/family"
if [ $s == 'monolith' ]; then
FAMILY_PROVIDER_NAME="${{ env.PROVIDER_NAME }}"
DOCS_DIR="./docs/monolith"
fi
echo "Publishing Docs for $FAMILY_PROVIDER_NAME, ${{ env.VER_MAJOR_MINOR }}"
go run github.com/upbound/uptest/cmd/updoc@${{ env.UPTEST_VERSION }} upload --docs-dir=“${DOCS_DIR}” --name=“${FAMILY_PROVIDER_NAME}” --version=${{ env.VER_MAJOR_MINOR }} --bucket-name=bucket-marketplace-docs-production --cdn-domain=https://user-content.upbound.io
done
else
echo "This job can only be run on release branches"
exit 1
Expand Down

0 comments on commit 6aee415

Please sign in to comment.