-
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 #1 from JunJongHun/feature
CD 적용 및 Serverless 환경 구축
- Loading branch information
Showing
3 changed files
with
55 additions
and
1 deletion.
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,29 @@ | ||
name: Execute CodeBuild | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
|
||
jobs: | ||
buildAndTest: | ||
name: GithubAction | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
shell: bash | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: AWS 설정 | ||
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: ${{ secrets.AWS_REGION }} | ||
|
||
- name: CodeBuild 실행 | ||
uses: aws-actions/[email protected] | ||
with: | ||
project-name: ${{ secrets.AWS_CODEBUILD_PROJECT_NAME }} |
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,23 @@ | ||
version: 0.2 | ||
phases: | ||
pre_build: | ||
commands: | ||
- echo Installing source NPM dependencies... | ||
- npm install | ||
build: | ||
commands: | ||
- echo Build started on 'date' | ||
- npm run build | ||
post_build: | ||
commands: | ||
# copy the contents of /build to S3 | ||
- aws s3 cp --recursive ./build s3://arooo-vite-react-deploy-s3-bucket/ | ||
# set the cache-control headers for index.html to prevent | ||
# browser caching | ||
- aws s3 cp --cache-control="max-age=0, no-cache, no-store, must-revalidate" ./build/index.html s3://arooo-vite-react-deploy-s3-bucket/ | ||
# Invalidate the CloudFront cache | ||
- aws cloudfront create-invalidation --distribution-id E33PEHWJIFQF6A --paths /* | ||
artifacts: | ||
files: | ||
- 'build/*' | ||
- 'build/**/*' |
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 |
---|---|---|
@@ -1,5 +1,7 @@ | ||
import axios from 'axios'; | ||
|
||
export const BASE_API_URL = 'https://api.a.com'; | ||
// export const BASE_API_URL = 'https://api.a.com'; | ||
export const BASE_API_URL = | ||
'https://5rf59007ej.execute-api.ap-northeast-2.amazonaws.com'; | ||
|
||
axios.defaults.baseURL = BASE_API_URL; |