__Prod__Deploy_docusaurus #380
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: __Prod__Deploy_docusaurus | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| docBuildBranch: | |
| description: 'doc-build branch to build with' | |
| required: true | |
| default: 'main' | |
| type: string | |
| schedule: | |
| - cron: "5 10 * * 1-5" | |
| env: | |
| AWS_KEY: ${{ secrets.AWS_KEY }} | |
| AWS_SECRET: ${{ secrets.AWS_SECRET }} | |
| jobs: | |
| prod_deploy: | |
| env: | |
| INPUTS_BRANCH: "${{ inputs.docBuildBranch || 'main' }}" | |
| runs-on: ubuntu-24.04-arm | |
| steps: | |
| - uses: actions/checkout@v3 | |
| with: | |
| ref: ${{ env.INPUTS_BRANCH }} | |
| - uses: actions/setup-node@v3 | |
| with: | |
| node-version: 24 | |
| cache: 'yarn' | |
| cache-dependency-path: 'yarn.lock' | |
| - uses: actions/cache@v3 | |
| id: cache | |
| with: | |
| path: ./node_modules | |
| key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-yarn- | |
| - name: Configure AWS Credentials | |
| uses: aws-actions/configure-aws-credentials@v4 | |
| with: | |
| aws-access-key-id: ${{ secrets.AWS_KEY }} | |
| aws-secret-access-key: ${{ secrets.AWS_SECRET }} | |
| aws-region: us-west-2 | |
| - uses: actions/checkout@v3 | |
| with: | |
| repository: starrocks/starrocks | |
| fetch-depth: 0 | |
| path: ./temp | |
| - name: Install Dependencies | |
| if: steps.cache.outputs.cache-hit != 'true' | |
| run: | | |
| yarn install --frozen-lockfile | |
| - run: npm run copy | |
| - name: Build website | |
| run: | | |
| export NODE_OPTIONS="--max_old_space_size=12288" | |
| export DOCUSAURUS_PERF_LOGGER=false | |
| export DOCUSAURUS_IGNORE_SSG_WARNINGS=true | |
| export BROWSERSLIST_IGNORE_OLD_DATA=true | |
| yarn build | |
| - name: Post-process llms.txt and markdown for agents | |
| run: node scripts/llms-postprocess.js build | |
| - name: sync to S3 | |
| env: | |
| BUCKET_SECRET: ${{ secrets.AWS_OSS_DOCS_PROD_BUCKET }} | |
| run: | | |
| aws s3 sync build/ s3://$BUCKET_SECRET/ --quiet --delete $* | |
| # Serve Markdown twins as text/markdown so agents (and content | |
| # negotiation) get a readable response body, not a file download. | |
| aws s3 cp build/ s3://$BUCKET_SECRET/ --quiet --recursive \ | |
| --exclude "*" --include "*.md" \ | |
| --content-type "text/markdown; charset=utf-8" | |
| - name: clean cdn cache | |
| env: | |
| CLOUFRONT_DIST_ID: ${{ secrets.AWS_OSS_DOCS_PROD_CLOUDFRONT_DIST_ID }} | |
| run: | | |
| aws cloudfront create-invalidation --distribution-id $CLOUFRONT_DIST_ID --paths "/*" | |