Generate Apps header and appdocs files #21
This file contains hidden or 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
| # 从 Contentful CMS 自动生成 App 应用的元数据文档(_include/)和 App 文档骨架。 | |
| # 触发方式:管理员手动触发(workflow_dispatch),需要仓库 Write 权限 + CONTENTFUL_ACCESS_TOKEN。 | |
| # 注意:该 workflow 生成的 _include/ 文件不应手工修改,属于自动管理内容。 | |
| name: Generate Apps header and appdocs files | |
| on: | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.x' | |
| cache: 'pip' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install Jinja2 requests contentful | |
| - name: Generate Markdown files | |
| env: | |
| CONTENTFUL_ACCESS_TOKEN: ${{ secrets.CONTENTFUL_GRAPHQLTOKEN }} | |
| run: | | |
| python builds/gen_md_from_contenful.py template/meta/zh_head.jinja2 versioned_docs/version-2.0/apps/_include | |
| python builds/gen_md_from_contenful.py template/meta/en_head.jinja2 i18n/en/docusaurus-plugin-content-docs/version-2.0/apps/_include | |
| python builds/gen_md_from_contenful.py template/meta/zh_app.jinja2 versioned_docs/version-2.0/apps --ignore-list template/meta/skip_file.json | |
| python builds/gen_md_from_contenful.py template/meta/en_app.jinja2 i18n/en/docusaurus-plugin-content-docs/version-2.0/apps --ignore-list template/meta/skip_file.json | |
| - name: Commit and push changes | |
| uses: stefanzweifel/git-auto-commit-action@v4 | |
| with: | |
| commit_message: Automated generation product markdown header |