Implement tab content components for TeamAnalysisResultPage (#276) #92
This file contains hidden or 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 Deployment | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- 'frontend/**' | |
workflow_dispatch: | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '20' | |
cache: 'npm' | |
cache-dependency-path: frontend/package-lock.json | |
- name: Install dependencies | |
working-directory: ./frontend | |
run: npm ci | |
- name: Run tests | |
working-directory: ./frontend | |
run: npm test | |
- name: Run linting and type checking | |
working-directory: ./frontend | |
run: | | |
npm run lint | |
npm run typecheck | |
- name: Build frontend | |
working-directory: ./frontend | |
run: npm run build | |
env: | |
VITE_API_URL: ${{ secrets.FRONTEND_API_URL }} | |
VITE_AUTH0_DOMAIN: ${{ secrets.AUTH0_DOMAIN }} | |
VITE_AUTH0_CLIENT_ID: ${{ secrets.AUTH0_CLIENT_ID }} | |
VITE_AUTH0_AUDIENCE: ${{ secrets.AUTH0_AUDIENCE }} | |
- 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: Deploy to S3 | |
run: | | |
aws s3 sync frontend/dist/ s3://${{ secrets.S3_BUCKET_NAME }}/ --delete | |
- name: Invalidate CloudFront cache | |
run: | | |
aws cloudfront create-invalidation --distribution-id ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }} --paths "/*" | |
- name: Send Slack notification | |
if: always() | |
uses: rtCamp/action-slack-notify@v2 | |
env: | |
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} | |
SLACK_CHANNEL: deployments | |
SLACK_COLOR: ${{ job.status }} | |
SLACK_TITLE: Frontend Deployment | |
SLACK_MESSAGE: 'Frontend deployment ${{ job.status }}' | |
SLACK_FOOTER: 'Toban Contribution Viewer' | |
continue-on-error: true |