Frontend ReadMe updated #99
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Frontend Production Branch CI/CD | |
on: | |
pull_request: | |
branches: | |
- main | |
paths: | |
- "frontend/**" | |
jobs: | |
frontend-tests: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "20.x" | |
- name: Install frontend dependencies | |
working-directory: ./frontend | |
run: npm install --include=dev | |
- name: Run full frontend test suite | |
working-directory: ./frontend | |
run: | | |
npm run test:unit | |
npm run test:integration | |
npm run test:e2e | |
deploy-frontend: | |
runs-on: ubuntu-latest | |
needs: frontend-tests | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "20.x" | |
- name: Install frontend dependencies | |
working-directory: ./frontend | |
run: npm install --include=dev | |
- name: Build frontend | |
working-directory: ./frontend | |
env: | |
WS_URL: ${{ secrets.WS_URL }} | |
run: npm run build | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
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: Set up SAM CLI | |
uses: aws-actions/setup-sam@v2 | |
with: | |
use-installer: true | |
- name: Make deploy script executable | |
run: chmod +x ./scripts/deploy-frontend.sh | |
- name: Deploy frontend to staging | |
run: ./scripts/deploy-frontend.sh production |