Index File Sync #456
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: Index File Sync | |
| on: | |
| schedule: | |
| - cron: '*/5 * * * *' | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| # Source-side mirrors only; Astro publishes the stable public routes from these files. | |
| concurrency: | |
| group: index-file-sync-${{ github.ref }} | |
| cancel-in-progress: false | |
| jobs: | |
| sync-managed-indexes: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| submodules: recursive | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: npm | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Sync managed package indexes | |
| env: | |
| SERVER_INDEX_SYNC_URL: ${{ secrets.SERVER_INDEX_SYNC_URL }} | |
| DESKTOP_INDEX_SYNC_URL: ${{ secrets.DESKTOP_INDEX_SYNC_URL }} | |
| run: node ./scripts/sync-azure-index.mjs | |
| - name: Validate catalog | |
| run: npm run validate | |
| - name: Check managed file diff | |
| id: diff | |
| run: | | |
| if git diff --quiet -- src/data/public/index-catalog.json src/data/public/server/index.json src/data/public/desktop/index.json; then | |
| echo "changed=false" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "changed=true" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Commit managed mirror updates | |
| if: steps.diff.outputs.changed == 'true' | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git add src/data/public/index-catalog.json src/data/public/server/index.json src/data/public/desktop/index.json | |
| git commit -m "chore(index): sync managed package indexes" | |
| git push |