Skip to content

Commit

Permalink
Adding a workflow for publishing the docs
Browse files Browse the repository at this point in the history
Signed-off-by: ytimocin <ytimocin@microsoft.com>
  • Loading branch information
ytimocin committed Jan 12, 2025
1 parent fab7e81 commit 9d0f489
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 2 deletions.
73 changes: 73 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Generate and Publish CLI Docs

on:
release:
types: [published]
workflow_dispatch:

permissions:
contents: write
pull-requests: write

jobs:
generate-and-publish:
runs-on: ubuntu-latest

env:
TAG_NAME: ${{ github.event.release.tag_name || 'edge' }}

steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
path: pops

- name: Checkout Docs Repository
uses: actions/checkout@v4
with:
repository: prompt-ops/docs
path: docs

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.22
cache: false

- name: Install dependencies
run: go mod tidy
working-directory: pops

- name: Generate CLI Docs
run: |
mkdir -p release/docs
make generate-cli-docs OUTPUT_PATH=release/docs/
working-directory: pops

- name: Copy Generated Docs
run: |
mkdir -p docs/content/en/cli
cp -R pops/release/docs/* docs/content/en/cli/
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.POPS_GITHUB_OPS_PAT }}
path: docs
committer: pops-ci-bot <pops-ci-bot@users.noreply.github.com>
author: pops-ci-bot <pops-ci-bot@users.noreply.github.com>
signoff: true
commit-message: Update CLI documentation for release ${{ env.TAG_NAME }}
title: "📄 Update CLI Documentation for Release ${{ env.TAG_NAME }}"
body: |
This PR updates the CLI documentation to reflect the changes in release `${{ env.TAG_NAME }}`.
### Changes
- Updated CLI commands and usage examples.
- Added new features introduced in this release.
### How to Test
- Verify the generated documentation in the [docs repository](https://github.com/prompt-ops/docs).
base: main
branch: automated-docs-update/patch-${{ github.sha }}
delete-branch: true
6 changes: 4 additions & 2 deletions make/gendocs.mk
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
OUTPUT_PATH ?= docs

.PHONY: generate-cli-docs
generate-cli-docs:
@echo "Generating CLI docs for Prompt-Ops..."
@go run cmd/docgen/main.go docs
@echo "Generation complete."
@go run cmd/docgen/main.go $(OUTPUT_PATH)
@echo "Generation complete. Docs generated at $(OUTPUT_PATH)"

0 comments on commit 9d0f489

Please sign in to comment.