Migrate docs header & footer (server-rendered); header search uses ou… #31
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 All | |
| # Site-wide deploy. Runs on demand, and automatically when the shared theme changes | |
| # (themes/** affects every product). Branch mapping for pushes: production -> production, | |
| # main -> staging. Home publishes to the bucket root and runs first. | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| environment: | |
| description: 'Target environment' | |
| required: true | |
| default: production | |
| type: choice | |
| options: | |
| - staging | |
| - production | |
| push: | |
| branches: [ production, main ] | |
| paths: | |
| - 'themes/**' | |
| jobs: | |
| home: | |
| uses: ./.github/workflows/deploy_product.yml | |
| with: | |
| product_family: home | |
| environment: ${{ github.event_name == 'workflow_dispatch' && inputs.environment || (github.ref_name == 'production' && 'production' || 'staging') }} | |
| # Home publishes the bucket-root files; invalidate the Markdown/llms/404 outputs too, | |
| # not just the HTML (otherwise CloudFront serves a stale /index.md, /llms.txt, /404.html …). | |
| invalidate_paths: '/index.html /index.md /llms.txt /llms-full.txt /404.html' | |
| max_deletes: '0' | |
| secrets: inherit | |
| products: | |
| needs: [home] | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| product_family: | |
| - annotation | |
| - assembly | |
| - classification | |
| - comparison | |
| - conversion | |
| - editor | |
| - markdown | |
| - merger | |
| - metadata | |
| - parser | |
| - redaction | |
| - search | |
| - signature | |
| - viewer | |
| - watermark | |
| uses: ./.github/workflows/deploy_product.yml | |
| with: | |
| product_family: ${{ matrix.product_family }} | |
| environment: ${{ github.event_name == 'workflow_dispatch' && inputs.environment || (github.ref_name == 'production' && 'production' || 'staging') }} | |
| secrets: inherit | |
| # Rebuild the bucket-root aggregates from every product's SOURCE — no per-product build | |
| # artifacts needed: the 404 live-search index (/search-index.json) and the combined, | |
| # compacted whole-reference file (/llms-full.txt). Same job runs standalone in | |
| # refresh_search_index.yml on content pushes. | |
| search-index: | |
| if: ${{ !cancelled() }} | |
| runs-on: ubuntu-latest | |
| env: | |
| ENVIRONMENT: ${{ github.event_name == 'workflow_dispatch' && inputs.environment || (github.ref_name == 'production' && 'production' || 'staging') }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Build search-index.json from source | |
| run: python3 build_search_index.py --source content/sites/groupdocs --out search-index.json | |
| - name: Deploy search-index.json to bucket root | |
| run: | | |
| BUCKET=${{ env.ENVIRONMENT == 'production' && 'reference.groupdocs.com' || 'reference2.groupdocs.com' }} | |
| aws s3 cp search-index.json "s3://$BUCKET/search-index.json" \ | |
| --content-type "application/json; charset=utf-8" --region us-west-2 | |
| env: | |
| AWS_ACCESS_KEY_ID: ${{ secrets.ACCESS_KEY }} | |
| AWS_SECRET_ACCESS_KEY: ${{ secrets.SECRET_ACCESS }} | |
| - name: Build llms-full.txt from source | |
| run: | | |
| BASE=${{ env.ENVIRONMENT == 'production' && 'https://reference.groupdocs.com' || 'https://reference2.groupdocs.com' }} | |
| python3 build_llms_full.py --source content/sites/groupdocs --base-url "$BASE" --out llms-full.txt | |
| - name: Deploy llms-full.txt to bucket root | |
| run: | | |
| BUCKET=${{ env.ENVIRONMENT == 'production' && 'reference.groupdocs.com' || 'reference2.groupdocs.com' }} | |
| aws s3 cp llms-full.txt "s3://$BUCKET/llms-full.txt" \ | |
| --content-type "text/plain; charset=utf-8" --region us-west-2 | |
| env: | |
| AWS_ACCESS_KEY_ID: ${{ secrets.ACCESS_KEY }} | |
| AWS_SECRET_ACCESS_KEY: ${{ secrets.SECRET_ACCESS }} | |
| - name: Invalidate CloudFront | |
| uses: chetan/invalidate-cloudfront-action@v2 | |
| env: | |
| DISTRIBUTION: ${{ env.ENVIRONMENT == 'production' && secrets.AWS_DISTRIBUTION_PROD || secrets.AWS_DISTRIBUTION }} | |
| PATHS: '/search-index.json /llms-full.txt' | |
| AWS_REGION: 'us-west-2' | |
| AWS_ACCESS_KEY_ID: ${{ secrets.ACCESS_KEY }} | |
| AWS_SECRET_ACCESS_KEY: ${{ secrets.SECRET_ACCESS }} |