forked from projectcleanroom/clean_front
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from projectcleanroom/main
jest
- Loading branch information
Showing
29 changed files
with
1,638 additions
and
1,950 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: Frontend CI/CD | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
jobs: | ||
build-and-deploy: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '20' | ||
|
||
- name: Cache dependencies | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/.npm | ||
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.OS }}-node- | ||
- name: Install dependencies | ||
run: npm ci | ||
continue-on-error: false | ||
|
||
- name: Run tests | ||
run: npm test | ||
continue-on-error: false | ||
|
||
- name: Build project | ||
run: npm run build | ||
env: | ||
VITE_API_URL_MEMBER: ${{ secrets.API_URL_MEMBER }} | ||
VITE_API_URL_PARTNER: ${{ secrets.API_URL_PARTNER }} | ||
continue-on-error: false | ||
|
||
- 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: us-east-1 | ||
|
||
- name: Deploy to S3 | ||
run: | | ||
aws s3 sync dist/ s3://${{ secrets.S3_BUCKET }} --delete | ||
continue-on-error: false | ||
|
||
- name: Invalidate CloudFront cache | ||
run: | | ||
aws cloudfront create-invalidation --distribution-id ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }} --paths "/*" | ||
continue-on-error: false |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"CORSRules": [ | ||
{ | ||
"AllowedOrigins": [ | ||
"https://your-domain.com" | ||
], | ||
"AllowedMethods": [ | ||
"GET", | ||
"HEAD" | ||
], | ||
"AllowedHeaders": [ | ||
"*" | ||
], | ||
"MaxAgeSeconds": 3000 | ||
} | ||
] | ||
} |
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
Oops, something went wrong.