Public JSON Mirror #43979
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: Public JSON Mirror | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| source_url: | |
| description: 'Optional Pages deployment URL to mirror' | |
| required: false | |
| lag_days: | |
| description: 'How many days behind production to mirror' | |
| required: false | |
| default: '7' | |
| schedule: | |
| - cron: '23 18 * * *' | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: public-json-mirror | |
| cancel-in-progress: false | |
| jobs: | |
| deploy: | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| name: Publish JSON Mirror | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 1 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| - name: Mirror JSON from Cloudflare Pages | |
| run: node scripts/mirror-public-json.mjs | |
| env: | |
| CF_API_TOKEN: ${{ secrets.CF_API_TOKEN }} | |
| CF_ACCOUNT_ID: ${{ vars.CF_ACCOUNT_ID }} | |
| CF_PAGES_PROJECT: ${{ vars.CF_PAGES_PROJECT }} | |
| CF_PAGES_BRANCH: ${{ vars.CF_PAGES_BRANCH }} | |
| CF_PAGES_ENVIRONMENT: ${{ vars.CF_PAGES_ENVIRONMENT }} | |
| CF_PAGES_DOMAIN: ${{ vars.CF_PAGES_DOMAIN }} | |
| CF_ACCESS_CLIENT_ID: ${{ secrets.CF_ACCESS_CLIENT_ID }} | |
| CF_ACCESS_CLIENT_SECRET: ${{ secrets.CF_ACCESS_CLIENT_SECRET }} | |
| PUBLIC_MIRROR_CNAME: ${{ vars.PUBLIC_MIRROR_CNAME }} | |
| PUBLIC_MIRROR_LAG_DAYS: ${{ inputs.lag_days || vars.PUBLIC_MIRROR_LAG_DAYS || '7' }} | |
| PUBLIC_MIRROR_SOURCE_URL: ${{ inputs.source_url }} | |
| - name: Configure Pages | |
| uses: actions/configure-pages@v5 | |
| - name: Upload Pages artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: .public-pages | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |