docs: improve get started guide (#9) #5
This file contains hidden or 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: Docs | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- 'docs/**' | |
- 'learn/**' | |
- '.github/workflows/docs.yml' | |
# Allow manual triggering | |
workflow_dispatch: | |
# Prevent concurrent deployments to avoid conflicts | |
concurrency: | |
group: docs-deploy-${{ github.ref }} | |
cancel-in-progress: true | |
env: | |
# Repository specific variables | |
REPO_NAME: agentic-tools | |
DOCS_DEST_PATH: pages/mcp-server | |
LEARN_DEST_PATH: src/data/learn/mcp-server | |
NODE_VERSION: '20' | |
PNPM_VERSION: '10' # Or your desired pnpm version | |
jobs: | |
docs-deploy: | |
name: Sync and Deploy Documentation | |
runs-on: ubuntu-latest | |
timeout-minutes: 15 | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- name: Install pnpm | |
uses: pnpm/action-setup@v4 | |
with: | |
version: ${{ env.PNPM_VERSION }} | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
cache: 'pnpm' | |
- name: Install dependencies | |
run: pnpm install | |
- name: Clone docs repository | |
run: git clone https://x-access-token:${{ secrets.GH_HYPERWEB_PAT }}@github.com/hyperweb-io/docs.hyperweb.io.git external-docs | |
- name: Sync the docs and build | |
run: | | |
rsync -av --delete ./docs/ ./external-docs/${{ env.DOCS_DEST_PATH }}/ | |
cd external-docs | |
yarn install # This is for the external-docs repo, which uses yarn | |
yarn export | |
- name: Git push | |
run: | | |
cd external-docs | |
git config user.name 'GitHub Action' | |
git config user.email '[email protected]' | |
git add . | |
if git diff --cached --quiet; then | |
echo "No changes to commit." | |
else | |
git commit -m "Automated: Update ${{ env.REPO_NAME }} documentation" | |
git push | |
fi |