diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index aa6d0746c1d..cb9285a103e 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -1,5 +1,13 @@ -name: Publish to gh-pages +name: gh-pages + +# Note: we have a foot in two camps here, maybe more +# +# - docs/ldml is the spec, and it gets special handling and generation. Ends up cldr-smoke for now +# - docs/rfc needs to end up somewhere. for now, generate to github.io + +# - docs/site is an entire 'site' that gets deployed to what will be cldr.unicode.org +# This is now handled in site.yml permissions: pages: write @@ -57,7 +65,7 @@ jobs: with: ruby-version: 3.2 bundler-cache: true - - name: Build Jekyll part of the site + - name: Build Jekyll part of the site (not spec, not site/) run: | gem install bundler github-pages kramdown-parser-gfm # should pull in jekyll, etc. cd docs && github-pages build && mkdir -vp ../_site/ldml @@ -87,6 +95,7 @@ jobs: rsync -cav --delete-after -e "ssh -o UserKnownHostsFile=${HOME}/.knownhosts -i ${HOME}/.key -p ${CCC_PORT}" ./_site/ ${CCC_USER}@${CCC_HOST}:spec/$(basename ${GITHUB_REF_NAME})/ echo "::endgroup::" echo "Now go to https://cldr-smoke.unicode.org/spec/"$(basename ${GITHUB_REF_NAME}) + deploy: if: github.repository == 'unicode-org/cldr' && github.event_name == 'push' environment: diff --git a/.github/workflows/site.yml b/.github/workflows/site.yml new file mode 100644 index 00000000000..3c2fe56b7d8 --- /dev/null +++ b/.github/workflows/site.yml @@ -0,0 +1,58 @@ +name: CLDR Site + +permissions: + deployments: write + id-token: write + pull-requests: write + +on: + pull_request: + paths: + - "tools/scripts/tr-archive/**" + - "docs/**" + - '.github/workflows/gh-pages.yml' + push: + branches: + - main + - "maint/maint-*" + tags: + - "release-*" + # Only run if docs change. + paths: + - "tools/scripts/tr-archive/**" + - "docs/**" + - '.github/workflows/gh-pages.yml' + +jobs: + cloudflare: + runs-on: ubuntu-latest + environment: cloudflare + steps: + - uses: actions/checkout@v4 + with: + lfs: false + - uses: ruby/setup-ruby@v1 + with: + ruby-version: 3.2 + bundler-cache: true + - name: Setup Jekyll + run: 'gem install bundler jekyll kramdown-parser-gfm webrick' + - name: Build cldr.pages.dev + run: 'cd docs/site && jekyll build' + - name: Deploy cldr.pages.dev + id: deploy + uses: cloudflare/wrangler-action@v3 + with: + apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} + accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} + command: pages deploy ./_site --project-name=cldr + - name: Add deploy comment to PR + uses: actions/github-script@v7 + with: + script: | + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: '✨ deployed to <${{ steps.deploy.outputs.deployment-url }}>' + }) diff --git a/docs/_config.yml b/docs/_config.yml index 076f7760eb8..eaa4078cbb7 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -1,5 +1,7 @@ -name: CLDR LDML -title: CLDR LDML +# this config file is for NON-spec, NON-site stuff. That is, RFC and ?? + +name: CLDR LDML Top Matter +title: CLDR LDML Top Matter markdown: kramdown input: GFM @@ -14,19 +16,4 @@ exclude: - charts/keyboards/node_modules - charts/keyboards/node - ldml - -#include: -# - site/ - -# _config.yml - -# everything under 'site' should default to the 'page' layout -defaults: - - scope: - path: 'site' - values: - layout: page - -collections: - site: - output: true + - site diff --git a/docs/site/_config.yml b/docs/site/_config.yml new file mode 100644 index 00000000000..ab7eabda587 --- /dev/null +++ b/docs/site/_config.yml @@ -0,0 +1,21 @@ +# This is the config file for cldr.unicode.org + +name: CLDR Site +title: CLDR Site + +markdown: kramdown +input: GFM + +destination: ../../_site + +# Google Analytics +ga_tracking: UA-7672775-1 +ga_tracking_anonymize_ip: true # Use GDPR compliant Google Analytics settings + +# everything should default to the 'page' layout +defaults: + - scope: + path: '' + values: + layout: page + diff --git a/docs/_layouts/page.html b/docs/site/_layouts/page.html similarity index 88% rename from docs/_layouts/page.html rename to docs/site/_layouts/page.html index 875d4f5e715..adff46349b0 100644 --- a/docs/_layouts/page.html +++ b/docs/site/_layouts/page.html @@ -4,8 +4,8 @@