mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-10-30 04:15:45 +08:00
54 lines
1.5 KiB
YAML
54 lines
1.5 KiB
YAML
name: Sync LangBot Blog articles
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
schedule:
|
|
- cron: "17 2 * * *"
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
concurrency:
|
|
group: sync-langbot-blog-articles
|
|
cancel-in-progress: false
|
|
|
|
jobs:
|
|
sync:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Check out Wiki
|
|
uses: actions/checkout@v5
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Check out LangBot landing page
|
|
uses: actions/checkout@v5
|
|
with:
|
|
repository: langbot-app/langbot-landing-page
|
|
token: ${{ secrets.LANGBOT_WIKI_PUSH_TOKEN }}
|
|
path: .article-source
|
|
persist-credentials: false
|
|
|
|
- name: Synchronize articles and images
|
|
run: node scripts/sync-blog-articles.mjs --source .article-source
|
|
|
|
- name: Validate generated articles
|
|
run: |
|
|
node scripts/sync-blog-articles.mjs --check --source .article-source
|
|
node scripts/sync-blog-articles.mjs --check
|
|
npm test
|
|
npx --yes [email protected] validate
|
|
|
|
- name: Commit synchronized content
|
|
run: |
|
|
rm -rf .article-source
|
|
if git diff --quiet && test -z "$(git status --short)"; then
|
|
echo "LangBot Blog articles are already synchronized."
|
|
exit 0
|
|
fi
|
|
git config user.name "langbot-docs-bot"
|
|
git config user.email "[email protected]"
|
|
git add docs.json en/articles zh/articles ja/articles images/articles scripts/blog-articles-manifest.json
|
|
git commit -m "docs(articles): sync LangBot Blog"
|
|
git push
|