Skip to content

Commit

Permalink
Merge pull request #1 from JunJongHun/feature
Browse files Browse the repository at this point in the history
CD 적용 및 Serverless 환경 구축
  • Loading branch information
JunJongHun committed Apr 20, 2024
2 parents c05cd3a + 780f774 commit 612ecdd
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 1 deletion.
29 changes: 29 additions & 0 deletions .github/workflows/main.yaml
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 }}
23 changes: 23 additions & 0 deletions buildspec.yaml
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/**/*'
4 changes: 3 additions & 1 deletion src/apis/config.ts
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;

0 comments on commit 612ecdd

Please sign in to comment.