-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
47ec629
commit 724019d
Showing
5 changed files
with
115 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
name: 'Generate and Deploy Documentation' | ||
description: 'Generate and deploy documentation files.' | ||
inputs: | ||
tembo_repository: | ||
description: 'GitHub repository to work with for documentation generation.' | ||
required: true | ||
website_repository: | ||
description: 'Website repository to update with documentation.' | ||
required: true | ||
ssh_key: | ||
description: 'SSH key for repository access.' | ||
required: true | ||
tembo_branch: | ||
description: 'Branch to checkout for documentation generation.' | ||
required: true | ||
website_branch: | ||
description: 'Branch to update with generated documentation.' | ||
required: true | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Check out the tembo repo | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: ${{ inputs.tembo_repository }} | ||
ssh-key: ${{ inputs.ssh_key }} | ||
ref: ${{ inputs.tembo_branch }} | ||
path: 'tembo-repo' | ||
|
||
- name: Generate Documentation | ||
run: | | ||
cd tembo-repo/tembo-cli | ||
cargo run -- --markdown-help > ../command-reference.md | ||
shell: bash | ||
|
||
- name: Check out the website repo | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: ${{ inputs.website_repository }} | ||
ssh-key: ${{ inputs.ssh_key }} | ||
ref: main | ||
path: 'website-repo' | ||
|
||
- name: Copy documentation to website repository | ||
run: | | ||
mkdir -p website-repo/src/content/docs/development/cli/ | ||
ls -lah | ||
shell: bash | ||
|
||
- name: Commit and push documentation to website repository | ||
run: | | ||
cd website-repo | ||
git config user.name "coredb-service-user" | ||
git config user.email "[email protected]" | ||
git fetch origin ${{ inputs.website_branch }} | ||
git checkout ${{ inputs.website_branch }} | ||
cd .. | ||
cp tembo-repo/command-reference.md website-repo/src/content/docs/development/cli/ | ||
cd website-repo | ||
git add src/content/docs/development/cli/command-reference.md | ||
git status | ||
git commit -m "Update command reference documentation: ${SHORT_SHA}" && git push origin ${{ inputs.website_branch }} || echo "No change in docs!" | ||
shell: bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: Generate and Deploy Documentation | ||
|
||
on: | ||
push: | ||
paths: | ||
- 'tembo-cli/**' | ||
branches: | ||
- main | ||
|
||
jobs: | ||
generate_docs: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Install system dependencies | ||
run: | | ||
set -xe | ||
sudo apt-get update | ||
- name: Set version strings | ||
id: versions | ||
run: | | ||
echo "SHORT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_ENV | ||
echo "BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD)" >> $GITHUB_ENV | ||
- name: Generate and Deploy Docs | ||
uses: ./.github/actions/generate-docs | ||
with: | ||
tembo_repository: 'tembo-io/tembo' | ||
ssh_key: ${{ secrets.SERVICE_USER_GITHUB_SSH_KEY }} | ||
tembo_branch: 'main' | ||
website_branch: 'cli-updates' | ||
website_repository: 'tembo-io/website' |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters