mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-10-30 04:15:45 +08:00
[verified] feat: synchronize Blog articles into Wiki (#113)
Co-authored-by: dadachann <[email protected]>
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
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
|
||||
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-wiki-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
|
||||
Reference in New Issue
Block a user