diff --git a/.github/workflows/deploy-admin.yml b/.github/workflows/deploy-admin.yml new file mode 100644 index 0000000..f3819d1 --- /dev/null +++ b/.github/workflows/deploy-admin.yml @@ -0,0 +1,53 @@ +name: Deploy Admin Page to AWS + +on: + push: + branches: ["develop"] +env: + AWS_REGION: ap-northeast-2 + S3_BUCKET_NAME: v-admin.gdsc-knu.com +permissions: + contents: read + +jobs: + deploy: + name: Deploy + runs-on: ubuntu-latest + steps: + - name: Checkout Code + uses: actions/checkout@v4 + + - name: Install NodeJS + uses: actions/setup-node@v4 + with: + node-version: 22 + + - name: Install yarn + run: | + npm install -g yarn + + - name: Create .env file + run: | + echo "VITE_APP_BASE_URL=${{ secrets.VITE_APP_BASE_URL }}" >> .env + echo "VITE_ENV"=${{ secrets.VITE_ENV }} >> .env + + - name: Install Dependencies + run: yarn install--frozen-lockfile + + - name: Build + run: CI='' yarn run build + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: ${{ env.AWS_REGION }} + + - name: Upload to AWS S3 + env: + BUCKET_NAME: ${{secrets.ADMIN_BUCKET_NAME}} + run: aws s3 sync packages/admin/dist s3://$BUCKET_NAME --delete + + - name: Invalidate Cloudfront Cache + run: aws cloudfront create-invalidation --distribution-id ${{secrets.ADMIN_CLOUDFRONT_ID}} --paths /* diff --git a/.gitignore b/.gitignore index b512c09..06bc1e7 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ -node_modules \ No newline at end of file +node_modules + +.DS_Store \ No newline at end of file diff --git a/packages/.DS_Store b/packages/.DS_Store index 3c14de1..15192ae 100644 Binary files a/packages/.DS_Store and b/packages/.DS_Store differ diff --git a/packages/admin/.eslintignore b/packages/admin/.eslintignore index 0506d83..f6a4267 100644 --- a/packages/admin/.eslintignore +++ b/packages/admin/.eslintignore @@ -1,2 +1,6 @@ vite.config.ts -jest.config.ts \ No newline at end of file +jest.config.ts + +dist + +.github \ No newline at end of file diff --git a/packages/admin/.prettierignore b/packages/admin/.prettierignore new file mode 100644 index 0000000..6df85bc --- /dev/null +++ b/packages/admin/.prettierignore @@ -0,0 +1,4 @@ +node_modules +.vscode +.github +dist diff --git a/packages/admin/index.html b/packages/admin/index.html index e4b78ea..1298ca3 100644 --- a/packages/admin/index.html +++ b/packages/admin/index.html @@ -1,13 +1,13 @@ - - - - - Vite + React + TS - - -
- - + + + + + Admin | Vision Challengethon + + +
+ + diff --git a/packages/admin/public/favicon.png b/packages/admin/public/favicon.png new file mode 100644 index 0000000..622dfc0 Binary files /dev/null and b/packages/admin/public/favicon.png differ diff --git a/packages/admin/public/vite.svg b/packages/admin/public/vite.svg deleted file mode 100644 index e7b8dfb..0000000 --- a/packages/admin/public/vite.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file