name: Production CI/CD Pipeline on: push: branches: - main jobs: build-and-test: runs-on: ubuntu-latest container: node:22 steps: - name: Checkout Code uses: https://github.com/actions/checkout@v4 - name: Install dependencies run: npm ci - name: Lint run: npm run lint - name: Test run: npm run test - name: Build run: npm run build - name: Upload Build Artifact uses: https://github.com/actions/upload-artifact@v3 with: name: dist path: dist/ deploy-prod: needs: build-and-test runs-on: ubuntu-latest container: node:22 steps: - name: Download Build Artifact uses: https://github.com/actions/download-artifact@v3 with: name: dist path: dist - name: Install AWS CLI run: | apt-get update && apt-get install -y awscli - name: Deploy to S3 run: aws s3 sync dist/ s3://partnerproductionsite --delete - name: Invalidate CloudFront run: aws cloudfront create-invalidation --distribution-id EBBGP8E0MLQNJ --paths "/*"