Skip to content

Merge pull request #516 from canopas/fixes-in-ios-page #45

Merge pull request #516 from canopas/fixes-in-ios-page

Merge pull request #516 from canopas/fixes-in-ios-page #45

name: DeployFrontendProd
on:
push:
branches:
- "master"
jobs:
deploy-frontend-prod:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- name: Checkout
uses: actions/[email protected]
- uses: actions/setup-node@v1
with:
node-version: "20"
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/github-actions-frontend-access
aws-region: ap-south-1
- name: Build frontend and copy to S3
run: |
cd nuxt-frontend
sed -i "s|VITE_IFRAMELY_KEY_VALUE|${{ secrets.IFRAMELY_KEY }}|g" config.prod.js
sed -i "s|VITE_RECAPTCHA_SITE_KEY_VALUE|${{ secrets.RECAPTCHA_SITE_KEY }}|g" config.prod.js
mv config.prod.js config.js
sh ./../deploy/generate-sitemap.sh https://canopas.com https://prod-stack-api.canopas.com
yarn install --frozen-lockfile && yarn generate
aws s3 sync ./.output/public s3://canopas.com --exclude "*.js"
aws s3 sync ./.output/public s3://canopas.com --include "*.js" --content-type "application/javascript"
aws cloudfront create-invalidation --distribution-id ${{ secrets.PROD_CLOUDFRONT_DISTRIBUTION_ID }} --paths "/*"