[DO NOT MERGE] Auto publish pr docs #695
Workflow file for this run
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
name: Continuous Integration | |
on: | |
pull_request: | |
workflow_dispatch: | |
release: | |
types: [published] | |
jobs: | |
update: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
with: | |
path: cli | |
submodules: recursive | |
- name: Checkout tools repo | |
uses: actions/checkout@v4 | |
with: | |
repository: temporalio/documentation | |
path: docs | |
- name: Setup Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.22' | |
- name: Generate CLI docs | |
run: | | |
set -x | |
pwd | |
echo "$pwd" | |
ls | |
ls cli/temporalcli | |
ls cli/temporalcli/internal | |
ls cli/temporalcli/internal/cmd | |
ls cli/temporalcli/internal/cmd/gen-docs | |
cd cli | |
cd temporalcli | |
cd internal | |
cd cmd | |
cd gen-docs | |
go run . | |
go run ./cli/temporalcli/internal/cmd/gen-docs | |
- name: Copy files over and generate PR | |
run: | | |
BRANCH_NAME="cli-update-docs-${{ github.ref_name }}" | |
cd docs | |
git checkout -b $BRANCH_NAME | |
cp ../cli/temporalcli/docs/*.mdx docs/cli/ | |
git add . | |
git commit -m "CLI docs update, autogenerated on CLI release, ${{ github.ref_name }}" | |
git push origin $BRANCH_NAME | |
gh pr create \ | |
--body "Autogenerated PR from https://github.com/temporalio/cli" \ | |
--title "CLI docs update $LATEST_TAG" \ | |
--head "$BRANCH_NAME" \ | |
--base "main" |