ci(docs): update last_changed table action (#27038)

Keeps track of fine-grained (per section) edit times for docs content.

Once daily, a GitHub Action runs that:

- Checks whether content hashes have changed for each section
- Updates the table that tracks content edit times if the hashes have changed

Note: The cron job isn't scheduled yet. I'll run the Action manually a few times to validate it, then turn it on in another PR.
This commit is contained in:
Charis authored and GitHub committed 2024-06-06 15:20:05 -04:00
1 parent a210d3a15e
commit c281dd0eb1
4 files changed
+234 -67

No files matched your search

+46
View File
@@ -0,0 +1,46 @@
name: "[Docs] Update last-changed dates"
on:
# Temporarily turned off until the action is validated manually
#
# schedule:
# - cron: '0 0 * * *'
workflow_dispatch:
inputs:
reset:
description: 'Reset last-updated dates using Git commit dates'
required: false
type: boolean
jobs:
deploy:
runs-on: ubuntu-latest
env:
NEXT_PUBLIC_SUPABASE_URL: ${{ secrets.SEARCH_SUPABASE_URL }}
SUPABASE_SERVICE_ROLE_KEY: ${{ secrets.SEARCH_SUPABASE_SERVICE_ROLE_KEY }}
steps:
- name: Check out repo
uses: actions/checkout@v4
with:
sparse-checkout: |
apps/docs
- name: Setup node
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
- name: Download dependencies
run: npm ci
- name: Update last-changed dates
working-directory: ./apps/docs
if: ${{ !inputs.reset }}
run: npm run last-changed
- name: Reset last-changed dates
working-directory: ./apps/docs
if: ${{ inputs.reset }}
run: npm run last-changed:reset