From a4df37fb976a630e6fe0ee8b6ae5b92e61e507ac Mon Sep 17 00:00:00 2001 From: Ronnie Miller Date: Wed, 8 May 2024 17:19:26 -0700 Subject: [PATCH] Updates for unified build (#7) * Updates for unified doc site * Update Astra CLI home page to newer landing page style * Add workflow for pull request draft builds --- .github/workflows/dispatch-deploy-draft.yml | 45 +++++++++++ docs-src/astra-cli-core/antora-astra-cli.yml | 6 +- docs-src/astra-cli-core/modules/ROOT/nav.adoc | 9 ++- .../modules/ROOT/pages/index.adoc | 80 +++++++++++-------- 4 files changed, 100 insertions(+), 40 deletions(-) create mode 100644 .github/workflows/dispatch-deploy-draft.yml diff --git a/.github/workflows/dispatch-deploy-draft.yml b/.github/workflows/dispatch-deploy-draft.yml new file mode 100644 index 0000000..dbbbf7b --- /dev/null +++ b/.github/workflows/dispatch-deploy-draft.yml @@ -0,0 +1,45 @@ +name: Deploy Draft + +on: + pull_request: + branches: + - '*' + +jobs: + dispatch-deploy: + runs-on: ubuntu-latest + + steps: + # Determine the build branch and draft branch for dispatch. + - name: Determine Dispatch Parameters + run: | + if [ "${{ github.event_name }}" == "pull_request" ]; then + # If this workflow is kicked off by a pull request, build + # a draft using the pull request base branch and PR branch. + build_branch="${{ github.base_ref }}" + draft_branch="${{ github.event.pull_request.head.ref }}" + else + if [ "$(basename ${{ github.event.ref }})" == "stage" ]; then + # This was a merge to stage so kick off a build to update stage draft. + build_branch=stage + draft_branch=stage + else + # Otherwise this is a push to one of the source branches so + # dispatch a build for the main draft to pick up the changes. + build_branch=main + draft_branch=main + fi + fi + echo "build_branch=$build_branch" >> $GITHUB_OUTPUT + echo "draft_branch=$draft_branch" >> $GITHUB_OUTPUT + id: branches + + - name: Deploy Draft + uses: convictional/trigger-workflow-and-wait@v1.6.1 + with: + owner: riptano + repo: datastax-docs-site + github_token: ${{ secrets.DISPATCH_GITHUB_TOKEN }} + github_user: ${{ secrets.DISPATCH_GITHUB_USER }} + workflow_file_name: deploy-draft.yml + client_payload: '{ "build_repository": "${{ github.event.repository.full_name }}", "build_branch": "${{ steps.branches.outputs.build_branch }}", "draft_branch": "${{ steps.branches.outputs.draft_branch }}", "pull_request_number": "${{ github.event.pull_request.number }}" }' diff --git a/docs-src/astra-cli-core/antora-astra-cli.yml b/docs-src/astra-cli-core/antora-astra-cli.yml index 50989a6..503bd7f 100644 --- a/docs-src/astra-cli-core/antora-astra-cli.yml +++ b/docs-src/astra-cli-core/antora-astra-cli.yml @@ -1,7 +1,11 @@ -name: docs +name: astra-cli title: Astra CLI version: '0.2' start_page: index.adoc nav: - modules/ROOT/nav.adoc + +asciidoc: + attributes: + astra_cli: 'Astra CLI' diff --git a/docs-src/astra-cli-core/modules/ROOT/nav.adoc b/docs-src/astra-cli-core/modules/ROOT/nav.adoc index 8fe2ff2..291a30b 100644 --- a/docs-src/astra-cli-core/modules/ROOT/nav.adoc +++ b/docs-src/astra-cli-core/modules/ROOT/nav.adoc @@ -1,4 +1,5 @@ -** xref:installation.adoc[] -** xref:getting-started.adoc[] -** xref:managing.adoc[] -** xref:astra-streaming-cli.adoc[] \ No newline at end of file +.{astra_cli} +* xref:installation.adoc[] +* xref:getting-started.adoc[] +* xref:managing.adoc[] +* xref:astra-streaming-cli.adoc[] diff --git a/docs-src/astra-cli-core/modules/ROOT/pages/index.adoc b/docs-src/astra-cli-core/modules/ROOT/pages/index.adoc index 5b3da84..6a68010 100644 --- a/docs-src/astra-cli-core/modules/ROOT/pages/index.adoc +++ b/docs-src/astra-cli-core/modules/ROOT/pages/index.adoc @@ -1,5 +1,5 @@ = {astra_cli} -:page-layout: gcx-landing +:page-layout: landing :data-uri: The DataStax Astra Command-Line Interface ({astra_cli}) is a set of commands used to create and manage Astra resources. @@ -20,41 +20,51 @@ Any user with the **Organization Administrator** role may use {astra_cli} comman Get started with the links below. -++++ -
+[subs="macros,attributes"] ++++ -[sidebar.landing-card] -.Installing and getting started -**** --- -* xref:installation.adoc[Install {astra_cli}] -* xref:getting-started.adoc[Get started] --- -[.landing-card-body-icon] -image::create-db-now.svg[icon description,40] -**** - -[sidebar.landing-card] -.Managing {astra_db} -**** --- -* xref:managing.adoc[] --- -[.landing-card-body-icon] -image::what-is-astra-db.svg[icon description,40] -**** - -[sidebar.landing-card] -.Managing {astra_stream} -**** --- -* xref:astra-streaming-cli.adoc[] --- -[.landing-card-body-icon] -image::what-is-astra-streaming.svg[icon description,40] -**** +
+ + +
+
+ svg:ROOT:create-db-now.svg[role="mx-auto my-auto w-8 h-8"] +
+ +

Installing and getting started

+ +
    +
  • xref:installation.adoc[Install {astra_cli}]
  • +
  • xref:getting-started.adoc[Get started]
  • +
+
+ + +
+
+ svg:ROOT:what-is-astra-db.svg[role="mx-auto my-auto w-8 h-8"] +
+ +

Managing {astra_db}

+ +
    +
  • xref:managing.adoc[]
  • +
+
+ + +
+
+ svg:ROOT:what-is-astra-streaming.svg[role="mx-auto my-auto w-8 h-8"] +
+ +

Managing {astra_stream}

+ +
    +
  • xref:astra-streaming-cli.adoc[]
  • +
+
-++++
-++++ \ No newline at end of file + +++++