Docs Sync #337
  
    
      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 Sync | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - "apps/docs/dockstat/**/*.md" | |
| schedule: | |
| # Run every 6 hours | |
| - cron: "0 */6 * * *" | |
| workflow_dispatch: # Allow manual triggering | |
| permissions: | |
| contents: write | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| sync-docs: | |
| name: Sync Documentation | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version-file: ".bun-version" | |
| - name: Sync docs | |
| env: | |
| OUTLINE_COLLECTION_ID: ${{ secrets.OUTLINE_COLLECTION_ID }} | |
| OUTLINE_API_KEY: ${{ secrets.OUTLINE_API_KEY }} | |
| run: | | |
| bash sync.sh | |
| git add . | |
| - name: Check for changes | |
| id: check_changes | |
| run: | | |
| if git diff --quiet && git diff --staged --quiet; then | |
| echo "No changes detected" | |
| echo "changes=false" >> $GITHUB_OUTPUT | |
| else | |
| echo "Changes detected" | |
| echo "changes=true" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Commit and push changes | |
| if: steps.check_changes.outputs.changes == 'true' | |
| run: | | |
| git config --local user.email "[email protected]" | |
| git config --local user.name "GitHub Action" | |
| git add . | |
| git commit -m "docs: sync documentation [skip ci]" | |
| git push | |
| - name: Check sync status | |
| run: | | |
| if [ $? -eq 0 ]; then | |
| echo "✅ Docs sync completed successfully" | |
| else | |
| echo "❌ Docs sync failed" | |
| exit 1 | |
| fi |