Skip to content

New docs: Updated and restructured Agent Assurance docs created a new… #378

New docs: Updated and restructured Agent Assurance docs created a new…

New docs: Updated and restructured Agent Assurance docs created a new… #378

name: 'Deployment (Prod - testmucom New Bucket)'
on:
push:
branches:
- testmuCom
jobs:
Docusaurus:
name: 'Deployment'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: testmuCom
fetch-depth: 0
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_MKT }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_MKT }}
aws-region: us-east-1
- name: 'Create env file'
run: |
touch .env
echo "HOST=${{ secrets.TYPESENSE_HOST }}" >> .env
echo "API=${{ secrets.PUBLIC_APY_TYPESENSE }}" >> .env
echo "TYPESENSE_COLLECTION_NAME=testmuai" >> .env
- name: Use Node.js 20.10.x
uses: actions/setup-node@v3
with:
node-version: 20.10.x
- name: Install dependencies and build
run: npm install --legacy-peer-deps && npm run build
env:
CI: false
- name: Copy files to S3 with AWS CLI
run: |
cp -R assets/ build/
cd build/
# Upload this build's hashed bundles FIRST, without --delete, so old
# bundles stay in place (old HTML still referencing them keeps working)
# and this build's new hashes exist in S3 before any HTML that
# references them can possibly go live. Doing this second would open a
# window where new HTML is already live but its bundle isn't uploaded
# yet, causing a 404 that CDNs/browsers can then cache for hours.
aws s3 sync . s3://lambdatest-prod-support-docs-testmucom/support/ --exclude '*' --include 'assets/js/*' --include 'assets/css/*'
# Then sync everything else (HTML etc.), deleting anything that no
# longer exists in this build, but never touching the hashed asset
# dirs so previously deployed bundles are never removed.
aws s3 sync . s3://lambdatest-prod-support-docs-testmucom/support/ --exclude 'robots.txt' --exclude 'assets/js/*' --exclude 'assets/css/*' --delete
- name: Invalidate CloudFront
run: |
aws cloudfront create-invalidation \
--distribution-id E3GY6CDKYL9RFL \
--paths "/support/*"
sleep 90
- name: Cloudflare Invalidation
run: |
curl -X POST "https://api.cloudflare.com/client/v4/zones/${{ secrets.CLOUDFLARE_ZONE_ID }}/purge_cache" \
-H "X-Auth-Email: ${{ secrets.CF_ACCOUNT }}" \
-H "X-Auth-Key: ${{ secrets.CF_API_SECRET }}" \
-H "Content-Type: application/json" \
--data '{"hosts":["${{ secrets.PROD_WEBSITE_URL }}"] }'
sleep 60