Skip to content

feat(recommendations): Api gateway aplicada a get heartbeat #29

feat(recommendations): Api gateway aplicada a get heartbeat

feat(recommendations): Api gateway aplicada a get heartbeat #29

Workflow file for this run

name: CI/CD for Frontend
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
types: [opened, synchronize]
jobs:
build-frontend:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '16'
cache: 'yarn'
cache-dependency-path: Sample-01/yarn.lock
- name: Install dependencies
run: cd Sample-01 && yarn install
- name: Create auth_config.json
run: |
echo '{
"domain": "'${{ secrets.AUTH0_DOMAIN }}'",
"clientId": "'${{ secrets.AUTH0_CLIENT_ID }}'",
"audience": "'${{ secrets.AUTH0_AUDIENCE }}'"
}' > Sample-01/src/auth_config.json
- name: Lint
run: cd Sample-01 && yarn lint
- name: Build
run: CI=false yarn build
working-directory: Sample-01
- name: Upload build artifacts
uses: actions/upload-artifact@v2
with:
name: build-artifacts
path: Sample-01/build
deploy-frontend:
runs-on: ubuntu-latest
needs: build-frontend
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Download build artifacts
uses: actions/download-artifact@v2
with:
name: build-artifacts
path: build
- name: Deploy to S3
uses: jakejarvis/s3-sync-action@v0.5.1
with:
args: --delete
env:
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: 'us-east-1'
SOURCE_DIR: 'build'
- name: Invalidate CloudFront Cache
uses: badsyntax/github-action-aws-cloudfront@v1.0.1
with:
invalidate-paths: '/*'
distribution-id: ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }}
default-root-object: 'index.html'
aws-region: 'us-east-1'
origin-prefix: ''
include-origin-prefix: 'false'
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}