Skip to content

deploy: region 관련 오류 수정 #7

deploy: region 관련 오류 수정

deploy: region 관련 오류 수정 #7

Workflow file for this run

name: Deploy Admin Page to AWS
on:
pull_request:
branches: ["develop"]
workflow_dispatch:
env:
AWS_REGION: ap-northeast-2
ADMIN_BUCKET_NAME: vision.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
- name: Install Dependencies
run: yarn admin install
- name: Build
run: yarn admin 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: ${{env.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 /*