Sync Astro Docs #295
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: Sync Astro Docs | |
| on: | |
| schedule: | |
| - cron: "0 0 * * *" | |
| jobs: | |
| sync-docs: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| - name: Install git-restore-mtime | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install git-restore-mtime | |
| - name: Clone Astro docs repository | |
| uses: actions/checkout@v5 | |
| with: | |
| repository: withastro/docs | |
| path: astro-docs | |
| - name: Clone Starlight repository | |
| uses: actions/checkout@v5 | |
| with: | |
| repository: withastro/starlight | |
| path: starlight | |
| - name: Setup Rclone | |
| uses: AnimMouse/setup-rclone@v1 | |
| with: | |
| rclone_config: ${{ secrets.RCLONE_CONFIG }} | |
| - name: Sync Astro docs | |
| working-directory: ./astro-docs | |
| run: | | |
| git restore-mtime | |
| rclone sync ./src/content/docs/en astro-mcp:astro-docs/astro --include "*.mdx" --header-upload "Content-Type: text/mdx" | |
| rclone sync ./src/content/docs/en astro-mcp:astro-docs/astro --include "*.md" --header-upload "Content-Type: text/markdown" | |
| - name: Sync Starlight docs | |
| working-directory: ./starlight | |
| run: | | |
| git restore-mtime | |
| find ./docs/src/content/docs -mindepth 1 -maxdepth 1 -not \( -name "components" -o -name "environmental-impact.md" -o -name "getting-started.mdx" -o -name "guides" -o -name "index.mdx" -o -name "manual-setup.mdx" -o -name "reference" -o -name "resources" \) -print0 | xargs -0 rm -rf | |
| rclone sync ./docs/src/content/docs astro-mcp:astro-docs/starlight --include "*.mdx" --header-upload "Content-Type: text/mdx" | |
| rclone sync ./docs/src/content/docs astro-mcp:astro-docs/starlight --include "*.md" --header-upload "Content-Type: text/markdown" |