CLDR-19231 spec: v48: update spec URLs and job title #1258
Workflow file for this run
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
| # yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json | |
| name: CLDR Site | |
| permissions: | |
| deployments: write | |
| id-token: write | |
| pull-requests: write | |
| on: | |
| pull_request: | |
| paths: | |
| # - "tools/scripts/tr-archive/**" | |
| - "docs/site/**" | |
| - '.github/workflows/site.yml' | |
| push: | |
| branches: | |
| - main | |
| # Only run if docs change. | |
| paths: | |
| # - "tools/scripts/tr-archive/**" | |
| - "docs/site/**" | |
| - '.github/workflows/site.yml' | |
| jobs: | |
| cloudflare: | |
| if: github.event_name == 'push' || github.event_name == 'pull_request' | |
| runs-on: ubuntu-latest | |
| environment: cloudflare | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| lfs: false | |
| fetch-depth: 2 | |
| - uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: 3.2 | |
| bundler-cache: true | |
| - name: Build Site | |
| run: 'sh tools/scripts/web/build-site.sh' | |
| - name: 'Remove wrangler.jsonc for now (this is the OLD pages build)' | |
| run: 'rm -f wrangler.jsonc' | |
| - name: Pre-install Wrangler | |
| if: (github.event_name == 'push') || (github.event.pull_request.head.repo.full_name == 'unicode-org/cldr') | |
| run: npm i -g wrangler@3.x | |
| - name: Deploy cldr.pages.dev | |
| if: (github.event_name == 'push') || (github.event.pull_request.head.repo.full_name == 'unicode-org/cldr') | |
| id: deploy | |
| uses: cloudflare/wrangler-action@v3 | |
| with: | |
| apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
| # use '--branch pr####' (pr###.cldr.pages.dev) for PRs, otherwise goes to cldr.unicode.org (production) | |
| command: pages deploy ./_site --project-name=cldr ${{ github.event_name == 'pull_request' && format('--branch pr{0}', github.event.pull_request.number) || '' }} | |
| - name: Calculate changed site files | |
| id: prdiff | |
| if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == 'unicode-org/cldr' | |
| run: | | |
| (echo -n 'prdiff=' ; git diff --name-status HEAD^ HEAD | cut -d/ -f2- | grep '^site/.*\.md$' | sed -e 's%^site/\(.*\)\.md%\\n- [\1.md](${{ steps.deploy.outputs.pages-deployment-alias-url }}/\1)%' | tr -d '\012' ) | tee -a $GITHUB_OUTPUT | |
| - name: Add deploy comment to PR | |
| uses: actions/github-script@v7 | |
| if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == 'unicode-org/cldr' | |
| with: | |
| script: | | |
| github.rest.issues.createComment({ | |
| issue_number: context.issue.number, | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| body: '✨ This commit deployed to <${{ steps.deploy.outputs.deployment-url }}> \n✨ This PR deployed to <${{ steps.deploy.outputs.pages-deployment-alias-url }}>\n\n**Changed Pages in the last commit:**\n\n${{ steps.prdiff.outputs.prdiff }}' | |
| }) | |
| github.rest.issues.addLabels({ | |
| issue_number: context.issue.number, | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| labels: ['Site Update'] | |
| }) |