diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 9dac567..ca31831 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,17 +1,25 @@ name: Deploy + on: push: branches: - main + pull_request: + branches: + - main + jobs: build: - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest + steps: - name: Checkout source code - uses: actions/checkout@v2 + uses: actions/checkout@v2 # workflow에서 액세스할 수 있도록 저장소를 체크아웃 - - name: Check Node v - run: node -v + # - name: Create .env file + # run: | + # echo "VITE_API_KEY=${{ secrets.VITE_API_KEY }}" >> .env + # echo "VITE_NCBI_URL=${{ secrets.VITE_NCBI_URL }}" >> .env - name: Install pnpm run: npm install -g pnpm@9.14.2 @@ -25,26 +33,16 @@ jobs: - name: Build run: pnpm build - - name: zip create - run: zip -qq -r ./build.zip . - shell: bash - - - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@v2 - with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: ${{ secrets.AWS_REGION }} - - - name: Upload to S3 + - name: S3 Deploy + run: aws s3 sync ./dist s3://toucheese-team4-s3/ --acl bucket-owner-full-control env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - run: aws s3 cp --region ap-northeast-2 ./build.zip s3://toucheese-team4-s3/build.zip - - - name: Deploy - run: aws deploy create-deployment - --application-name TOUCHEESE-TEAM4 - --deployment-config-name CodeDeployDefault.AllAtOnce - --deployment-group-name TOUCHEESE-TEAM4-Deploy-Group - --s3-location bucket=toucheese-team4-s3,key=build.zip,bundleType=zip + AWS_REGION: ${{ secrets.AWS_REGION }} + DISTRIBUTION: ${{ secrets.AWS_DISTRIBUTION_ID }} + - name: Invalidate CloudFront Cache + uses: chetan/invalidate-cloudfront-action@master + env: + AWS_DISTRIBUTION: ${{ secrets.AWS_DISTRIBUTION_ID }} + PATHS: '/index.html' + continue-on-error: true diff --git a/tsconfig.app.tsbuildinfo b/tsconfig.app.tsbuildinfo new file mode 100644 index 0000000..fe0847b --- /dev/null +++ b/tsconfig.app.tsbuildinfo @@ -0,0 +1 @@ +{"root":["./src/app.tsx","./src/main.tsx","./src/routes.tsx","./src/vite-env.d.ts","./src/components/layout/layout.tsx","./src/hooks/usehook.ts","./src/pages/home/home.tsx","./src/store/useuserstore.ts","./src/styles/common.tsx","./src/styles/globalstyles.tsx","./src/styles/variables.tsx","./src/tests/home.test.tsx","./src/types/types.ts","./src/utils/utils.ts"],"version":"5.6.3"} \ No newline at end of file