Document Service API intro rework: more details, updated structure (#… #1684
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
| name: Deploy Production version | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| generate-llms: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| actions: read | |
| outputs: | |
| files-changed: ${{ steps.check-changes.outputs.changed }} | |
| steps: | |
| - name: 📥 Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.PAT_AUTO_MERGE_LLMS_TXT_TOKEN }} | |
| fetch-depth: 0 | |
| - name: 🟢 Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: 📦 Install dependencies | |
| working-directory: ./docusaurus | |
| run: npm install | |
| - name: 🤖 Generate LLMs files | |
| working-directory: ./docusaurus | |
| run: npm run generate-llms | |
| - name: 🤖 Generate LLMs code file | |
| working-directory: ./docusaurus | |
| run: | | |
| node scripts/llms/generate-llms-code.js --anchors --all --output static/llms-code.txt | |
| node scripts/llms/validate-llms-code.js --path static/llms-code.txt --strict --verify-anchors --project-root .. | |
| - name: 🔍 Check for changes | |
| id: check-changes | |
| run: | | |
| if git diff --quiet HEAD -- docusaurus/static/llms.txt docusaurus/static/llms-full.txt docusaurus/static/llms-code.txt; then | |
| echo "changed=false" >> $GITHUB_OUTPUT | |
| echo "🔄 No changes in LLMs files" | |
| else | |
| echo "changed=true" >> $GITHUB_OUTPUT | |
| echo "📝 LLMs files have changes" | |
| fi | |
| - name: 📤 Commit and push changes | |
| if: steps.check-changes.outputs.changed == 'true' | |
| run: | | |
| git config --local user.email "[email protected]" | |
| git config --local user.name "GitHub Actions" | |
| git add docusaurus/static/llms.txt docusaurus/static/llms-full.txt docusaurus/static/llms-code.txt | |
| git commit -m "🤖 Update LLMs files [skip ci]" | |
| git push | |
| deploy-prod: | |
| runs-on: ubuntu-latest | |
| needs: generate-llms | |
| steps: | |
| - name: Get Vercel deployment URL | |
| id: get-url-prod | |
| uses: derrickmehaffy/vercel-preview-url@main | |
| env: | |
| VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }} | |
| with: | |
| vercel_team_id: 'strapijs' | |
| vercel_target: 'production' | |
| vercel_app: 'documentation' | |
| vercel_project_id: ${{ secrets.VERCEL_PROJECT_ID }} | |
| - name: Wait for Vercel deploy to complete | |
| uses: UnlyEd/[email protected] | |
| id: await-vercel-prod | |
| env: | |
| VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }} | |
| with: | |
| deployment-url: ${{ steps.get-url-prod.outputs.preview_url }} | |
| timeout: 600 | |
| - name: Output debug status | |
| run: "echo The deployment at ${{ fromJson(steps.await-vercel-prod.outputs.deploymentDetails).url }} is ${{ fromJson(steps.await-vercel-prod.outputs.deploymentDetails).readyState }}" | |
| - name: Invalidate CloudFront Cache | |
| uses: chetan/invalidate-cloudfront-action@v2 | |
| id: invalid-cloudfront-prod | |
| env: | |
| DISTRIBUTION: ${{ secrets.PROD_DISTRIBUTION }} | |
| PATHS: "/*" | |
| AWS_REGION: ${{ secrets.PROD_REGION }} | |
| AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
| AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
| - name: Algolia crawler creation and crawl | |
| uses: algolia/[email protected] | |
| id: update-algolia-index-prod | |
| with: | |
| crawler-user-id: ${{ secrets.CRAWLER_USER_ID }} | |
| crawler-api-key: ${{ secrets.CRAWLER_API_KEY }} | |
| algolia-app-id: ${{ secrets.ALGOLIA_APP_ID }} | |
| algolia-api-key: ${{ secrets.ALGOLIA_API_KEY }} | |
| site-url: 'https://docs.strapi.io' | |
| crawler-name: 'cmsDocs' |