diff --git a/.github/workflows/azure-static-web-apps-green-glacier-0df749200.yml b/.github/workflows/azure-static-web-apps-green-glacier-0df749200.yml new file mode 100644 index 0000000..c012caf --- /dev/null +++ b/.github/workflows/azure-static-web-apps-green-glacier-0df749200.yml @@ -0,0 +1,27 @@ +name: Azure Static Web Apps CI/CD + +on: + push: + branches: + - feature/129 + +jobs: + build_and_deploy_job: + runs-on: ubuntu-latest + name: Build and Deploy Job + steps: + - uses: actions/checkout@v3 + with: + submodules: true + lfs: false + fetch-depth: 0 + fetch-tags: true + - name: Build And Deploy + id: builddeploy + uses: Azure/static-web-apps-deploy@v1 + with: + azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_GREEN_GLACIER_0DF749200 }} + action: 'upload' + app_location: '/' + api_location: '' + output_location: 'dist' diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml deleted file mode 100644 index 2607555..0000000 --- a/.github/workflows/deploy.yml +++ /dev/null @@ -1,54 +0,0 @@ -name: Release CI/CD - -on: - push: - branches: - - main - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - fetch-depth: 0 - fetch-tags: true - - - name: Set up Node.js - uses: actions/setup-node@v3 - with: - node-version: '20.11.1' - - - name: Install Dependencies - run: npm ci - - - name: Build - env: - VITE_GA_ID: ${{ secrets.VITE_GA_ID }} - run: unset CI && npm run build - - - name: Create Deployment Package - run: zip -qq -r ./build.zip . - shell: bash - - - name: Configure AWS credentials - 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: Upload to S3 - env: - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - run: aws s3 cp --region ap-northeast-2 ./build.zip s3://smunity/build.zip - - - name: Deploy - run: aws deploy create-deployment - --application-name smunity - --deployment-config-name CodeDeployDefault.AllAtOnce - --deployment-group-name smunity-web - --s3-location bucket=smunity,key=build.zip,bundleType=zip diff --git a/public/staticwebapp.config.json b/public/staticwebapp.config.json new file mode 100644 index 0000000..b6c3654 --- /dev/null +++ b/public/staticwebapp.config.json @@ -0,0 +1,16 @@ +{ + "routes": [ + { + "route": "/api/*", + "allowedRoles": ["anonymous"], + "rewrite": "https://smunity.co.kr/api/{*path}" + } + ], + "navigationFallback": { + "rewrite": "/index.html", + "exclude": ["/assets/*", "/*.css", "/*.js", "/*.png", "/*.jpg", "/*.svg", "/*.ico"] + }, + "globalHeaders": { + "X-Content-Type-Options": "nosniff" + } +}