Skip to content

Update S3-deployment.yaml #12

Update S3-deployment.yaml

Update S3-deployment.yaml #12

name: ALL SAAS LEARN FRIEND DEV BUILD Deployment
on:
push:
branches:
- all-saas-0.1.0-dev
jobs:
deploy:
runs-on: ubuntu-latest
environment: all-saas-dev
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "20.18.0"
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}
- name: Clean up node_modules and package-lock.json
run: |
rm -rf node_modules
rm -f package-lock.json
- name: Install Dependencies
run: npm install --legacy-peer-deps
- name: Build and Package Application
env:
WDS_SOCKET_PORT: ${{ vars.WDS_SOCKET_PORT }}
WDS_SOCKET_PATH: ${{ vars.WDS_SOCKET_PATH }}
WDS_SOCKET_HOST: ${{ vars.WDS_SOCKET_HOST }}
REACT_APP_VER: ${{ vars.REACT_APP_VER }}
REACT_APP_URL: ${{ vars.REACT_APP_URL }}
REACT_APP_UID: ${{ vars.REACT_APP_UID }}
REACT_APP_TIMEDIFF: ${{ vars.REACT_APP_TIMEDIFF }}
REACT_APP_TELEMETRY_MODE: ${{ vars.REACT_APP_TELEMETRY_MODE }}
REACT_APP_PID: ${{ vars.REACT_APP_PID }}
REACT_APP_ID: ${{ vars.REACT_APP_ID }}
REACT_APP_HOST: ${{ vars.REACT_APP_HOST }}
REACT_APP_ENV: ${{ vars.REACT_APP_ENV }}
REACT_APP_ENDPOINT: ${{ vars.REACT_APP_ENDPOINT }}
REACT_APP_CONTENT_SIZE: ${{ vars.REACT_APP_CONTENT_SIZE }}
REACT_APP_CHANNEL: ${{ vars.REACT_APP_CHANNEL }}
REACT_APP_CAPTURE_AUDIO: ${{ vars.REACT_APP_CAPTURE_AUDIO }}
REACT_APP_BATCHSIZE: ${{ vars.REACT_APP_BATCHSIZE }}
REACT_APP_AWS_S3_REGION: ${{ vars.REACT_APP_AWS_S3_REGION }}
REACT_APP_AWS_S3_BUCKET_URL: ${{ vars.REACT_APP_AWS_S3_BUCKET_URL }}
REACT_APP_AWS_S3_BUCKET_NAME: ${{ vars.REACT_APP_AWS_S3_BUCKET_NAME }}
REACT_APP_AUTHTOKEN: ${{ vars.REACT_APP_AUTHTOKEN }}
REACT_APP_ASR_API_KEY: ${{ vars.REACT_APP_ASR_API_KEY }}
REACT_APP_APISLUG: ${{ vars.REACT_APP_APISLUG }}
PUBLIC_URL: ${{ vars.PUBLIC_URL }}
NODE_ENV: ${{ vars.NODE_ENV }}
FAST_REFRESH: ${{ vars.FAST_REFRESH }}
REACT_APP_AWS_ACCESS_KEY_ID: ${{ secrets.REACT_APP_AWS_ACCESS_KEY_ID }}
REACT_APP_AWS_SECRET_ACCESS_KEY: ${{ secrets.REACT_APP_AWS_SECRET_ACCESS_KEY }}
CI: false # Disabling CI to not treat warnings as errors
run: npm run build
- name: Deploy to S3 Bucket
run: aws s3 sync ./build s3://all-saas-learnerapp/learn-friend-build/
- name: Debug Environment Variables
run: |
echo "REACT_APP_AWS_S3_BUCKET_NAME: $REACT_APP_AWS_S3_BUCKET_NAME"
echo "AWS_REGION: $AWS_REGION"
echo "secrate": ${{ vars.REACT_APP_AWS_S3_BUCKET_NAME }}
- name: Cloudfront Invalidation
uses: chetan/invalidate-cloudfront-action@master
env:
DISTRIBUTION: ${{ secrets.AWS_DISTRIBUTION }}
PATHS: "/*"
AWS_REGION: ${{ secrets.AWS_REGION }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}