Skip to content

Commit

Permalink
Merge pull request #21 from anynines/a8s_2663_add-staging_docs_enviro…
Browse files Browse the repository at this point in the history
…nment

Add staging docs environment
  • Loading branch information
abdulhaseeb3 authored Oct 17, 2024
2 parents c2287cb + 265e5e0 commit 98acd54
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 2 deletions.
27 changes: 25 additions & 2 deletions .github/workflows/trigger-website-update.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,37 @@ on:
- main
paths:
- 'docs/**'
pull_request:
paths:
- 'docs/**'

jobs:
send-event:
# Dispatch event for production build on docs changes in main branch
production-build:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- name: Repository Dispatch
- name: Dispatch Production Build Event
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.PAT }}
repository: anynines/klutchio-website
event-type: klutch-docs-updated-on-main

# Dispatch event for PR preview on docs
preview-build:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- name: Dispatch PR Preview Event
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.PAT }}
repository: anynines/klutchio-website
event-type: preview-docs-pr
client-payload: >
{
"pr_number": "${{ github.event.number }}",
"repo": "${{ github.repository }}",
"sha": "${{ github.event.pull_request.head.sha }}"
}
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,22 @@ Advantages include:

[go.work docs]: https://go.dev/doc/tutorial/workspaces

## Documentation Workflow

We use GitHub Actions to automate our documentation process:

- Pull requests modifying `docs/` trigger preview builds.
- Previews are deployed to PR-specific URLs for easy review.
- Merges to main automatically update the production documentation.
- Preview environments are cleaned up after PR merges.

When contributing to documentation:

1. Create a PR with your changes.
2. Check the automatically posted comment for the preview link.
3. Review your changes in the preview environment.
4. After approval and merge, changes will go live on the main site.

## Credits

- The Klutch Authors

0 comments on commit 98acd54

Please sign in to comment.