Skip to content

Merge pull request #2570 from surishubham/testmuCom #35

Merge pull request #2570 from surishubham/testmuCom

Merge pull request #2570 from surishubham/testmuCom #35

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
- 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/
aws s3 sync . s3://lambdatest-prod-support-docs-testmucom/support/ --exclude 'robots.txt' --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