Skip to content

Commit

Permalink
Updates for unified build (#7)
Browse files Browse the repository at this point in the history
* Updates for unified doc site

* Update Astra CLI home page to newer landing page style

* Add workflow for pull request draft builds
  • Loading branch information
mlr authored May 9, 2024
1 parent 1925fc3 commit a4df37f
Show file tree
Hide file tree
Showing 4 changed files with 100 additions and 40 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/dispatch-deploy-draft.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
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 }}" }'
6 changes: 5 additions & 1 deletion docs-src/astra-cli-core/antora-astra-cli.yml
Original file line number Diff line number Diff line change
@@ -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'
9 changes: 5 additions & 4 deletions docs-src/astra-cli-core/modules/ROOT/nav.adoc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
** xref:installation.adoc[]
** xref:getting-started.adoc[]
** xref:managing.adoc[]
** xref:astra-streaming-cli.adoc[]
.{astra_cli}
* xref:installation.adoc[]
* xref:getting-started.adoc[]
* xref:managing.adoc[]
* xref:astra-streaming-cli.adoc[]
80 changes: 45 additions & 35 deletions docs-src/astra-cli-core/modules/ROOT/pages/index.adoc
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -20,41 +20,51 @@ Any user with the **Organization Administrator** role may use {astra_cli} comman
Get started with the links below.

++++
<div class="landing-row">
[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]
****
<div class="grid lg:grid-rows-1 lg:grid-cols-3 gap-6 mt-6">
<!-- Installing and getting started Card -->
<div class="flex flex-col items-start gap-4 rounded border p-4">
<div class="rounded bg-level1 p-2">
svg:ROOT:create-db-now.svg[role="mx-auto my-auto w-8 h-8"]
</div>
<div><h3 class="discrete !text-h2 !m-0">Installing and getting started</h3></div>
<ul class="!m-0 [&>li]:my-2">
<li>xref:installation.adoc[Install {astra_cli}]</li>
<li>xref:getting-started.adoc[Get started]</li>
</ul>
</div>
<!-- Managing AstraDB Card -->
<div class="flex flex-col items-start gap-4 rounded border p-4">
<div class="rounded bg-level1 p-2">
svg:ROOT:what-is-astra-db.svg[role="mx-auto my-auto w-8 h-8"]
</div>
<div><h3 class="discrete !text-h2 !m-0">Managing {astra_db}</h3></div>
<ul class="!m-0 [&>li]:my-2">
<li>xref:managing.adoc[]</li>
</ul>
</div>
<!-- Managing Streaming Card -->
<div class="flex flex-col items-start gap-4 rounded border p-4">
<div class="rounded bg-level1 p-2">
svg:ROOT:what-is-astra-streaming.svg[role="mx-auto my-auto w-8 h-8"]
</div>
<div><h3 class="discrete !text-h2 !m-0">Managing {astra_stream}</h3></div>
<ul class="!m-0 [&>li]:my-2">
<li>xref:astra-streaming-cli.adoc[]</li>
</ul>
</div>
++++
</div>
++++
++++

0 comments on commit a4df37f

Please sign in to comment.