CLDR-18165 cla: add GitHub login #2203
Workflow file for this run
This file contains 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: 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 | |
deployments: write | |
id-token: write | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
- "maint/maint-*" | |
tags: | |
- "release-*" | |
# Only run if docs change. | |
paths: | |
- "tools/scripts/tr-archive/**" | |
- "docs/**" | |
- '.github/workflows/gh-pages.yml' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
lfs: false | |
- name: Cache local npm repository | |
uses: actions/cache@v4 | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-nodetr-${{ hashFiles('tools/scripts/tr-archive/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-nodetr- | |
nodetr- | |
- uses: nodenv/actions/node-version@v3 # setup using .node-version | |
- name: Run TR archiver | |
# Note: will update ToC if out of date | |
run: 'cd tools/scripts/tr-archive/ && npm ci && npm run build' | |
- name: Run Kbd Charts | |
run: 'cd docs/charts/keyboards && npm ci && npm run build' | |
- name: Upload tr35.zip | |
uses: actions/upload-artifact@v4 | |
with: | |
name: tr35-spec | |
path: tools/scripts/tr-archive/tr35.zip | |
- name: 'Run TR link extractor (experimental)' | |
# Note: see CLDR-16526 for making this an error | |
run: 'cd tools/scripts/tr-archive/ && npm run extract-link-targets || (echo Warning, please fix these ; true)' | |
- name: Lint Markdown | |
# Warn, don't fail yet | |
run: npx markdownlint-cli *.md {specs,docs}/*.md || (echo Warning, please fix these ; true) | |
- name: Note any changes | |
run: git status ; git diff | |
- uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: 3.2 | |
bundler-cache: true | |
- 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 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Rearrange stuff | |
run: 'cp -vr tools/scripts/tr-archive/dist/* ./_site/ldml/ && cp tools/scripts/tr-archive/reports-v2.css ./_site/' | |
- name: Deploy to GitHub Pages (main) | |
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
uses: actions/upload-pages-artifact@v2 | |
- name: Deploy to Smoketest | |
if: github.repository == 'unicode-org/cldr' && github.event_name == 'push' | |
shell: bash | |
env: | |
RSA_KEY_CCC: ${{ secrets.RSA_KEY_CCC }} | |
# the SSH port | |
CCC_USER: ${{ secrets.CCC_USER }} | |
CCC_PORT: 22 | |
# the SSH host | |
CCC_HOST: cldr-smoke.unicode.org | |
# the ~/.ssh/known_hosts line mentioning SMOKETEST_HOST | |
CCC_KNOWNHOSTS: ${{ secrets.CCC_KNOWNHOSTS }} | |
run: | | |
echo "::group::Publish HTML" | |
echo "${RSA_KEY_CCC}" > ${HOME}/.key && chmod go= ${HOME}/.key | |
echo "${CCC_KNOWNHOSTS}" > ${HOME}/.knownhosts && chmod go= ${HOME}/.knownhosts | |
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: | |
name: github-pages | |
url: ${{steps.deployment.outputs.page_url}} | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v2 | |
# only run one deployment at once. | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true |