Skip to content

CI testing

CI testing #9

Workflow file for this run

name: CI Checks (Linting and Formatting)
on:
push:
branches:
- master
- staging
pull_request:
branches:
- master
- staging
types:
- opened
- reopened
- synchronize
- ready_for_review
concurrency:
group: ci-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
lint-and-format:
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: "20"
- name: Clean install dependencies
run: |
rm -rf node_modules
npm ci
- name: Check formatting
run: npm run format:check
- name: Run linting
run: npm run lint
- name: Build frontend
run: npm run build
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- name: Trigger Amplify Deploy
run: |
BRANCH_NAME="${{ github.ref_name }}"
if [[ "$BRANCH_NAME" == "master" || "$BRANCH_NAME" == "staging" ]]; then
aws amplify start-job \
--app-id ${{ secrets.AMPLIFY_APP_ID }} \
--branch-name $BRANCH_NAME \
--job-type RELEASE
fi