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 @@ {{ page.title }} - - + + diff --git a/tools/scripts/web/docker/.gitignore b/tools/scripts/web/docker/.gitignore new file mode 100644 index 00000000000..0baf015229c --- /dev/null +++ b/tools/scripts/web/docker/.gitignore @@ -0,0 +1 @@ +/_site diff --git a/tools/scripts/web/docker/Dockerfile b/tools/scripts/web/docker/Dockerfile index a409613ea2d..2517642543a 100644 --- a/tools/scripts/web/docker/Dockerfile +++ b/tools/scripts/web/docker/Dockerfile @@ -1,2 +1,2 @@ -FROM jekyll/jekyll +FROM jekyll/jekyll:4.2.2 RUN gem install bundler github-pages kramdown-parser-gfm webrick diff --git a/tools/scripts/web/docker/README.md b/tools/scripts/web/docker/README.md index 029313be7d5..73d23405b86 100644 --- a/tools/scripts/web/docker/README.md +++ b/tools/scripts/web/docker/README.md @@ -1,7 +1,13 @@ -# Previewing locally +# Docker for CLDR Site + +## Previewing locally 1. install https://docker.io 2. `docker compose up` 3. visit +4. hit control-C to cancel the docker run. +## Building +1. `docker compose run -w /src site jekyll build` +2. output is in `./_site` here in this dir. diff --git a/tools/scripts/web/docker/docker-compose.yml b/tools/scripts/web/docker/docker-compose.yml index 448241eba6f..d0a3aecb86f 100644 --- a/tools/scripts/web/docker/docker-compose.yml +++ b/tools/scripts/web/docker/docker-compose.yml @@ -5,6 +5,7 @@ services: ports: - 4000:4000 volumes: - - ../../../../docs:/src + - ../../../../docs/site:/src:rw + - ./_site/:/_site:rw environment: - PAGES_REPO_NWO=unicode-org/cldr