diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml new file mode 100644 index 0000000..f8e3856 --- /dev/null +++ b/.github/workflows/main.yaml @@ -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/aws-codebuild-run-build@v1.0.13 + with: + project-name: ${{ secrets.AWS_CODEBUILD_PROJECT_NAME }} diff --git a/buildspec.yaml b/buildspec.yaml new file mode 100644 index 0000000..a81abcc --- /dev/null +++ b/buildspec.yaml @@ -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/**/*' diff --git a/src/apis/config.ts b/src/apis/config.ts index 9577139..d415c47 100644 --- a/src/apis/config.ts +++ b/src/apis/config.ts @@ -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;