[#256] Feat: 쿼리 팩토리 적용 및 네트워크 워터폴 최적화 (#263) #243
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: zzalmyu frontend continuous developments | |
on: | |
push: | |
branches: main | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install NVM and get latest LTS version | |
run: | | |
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash | |
export NVM_DIR="$HOME/.nvm" | |
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" | |
echo "NODE_VERSION=$(nvm version-remote --lts)" >> $GITHUB_ENV | |
- name: Set up Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
- uses: pnpm/action-setup@v3 | |
name: Install pnpm | |
with: | |
version: 8 | |
run_install: true | |
- name: Build | |
run: pnpm run build | |
env: | |
NEXT_PUBLIC_BASE_URL: ${{ secrets.NEXT_PUBLIC_BASE_URL }} | |
NEXT_PUBLIC_CHAT_URL: ${{ secrets.NEXT_PUBLIC_CHAT_URL }} | |
NEXT_PUBLIC_SENTRY_DSN: ${{ secrets.NEXT_PUBLIC_SENTRY_DSN }} | |
- 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: ap-northeast-2 | |
- name: Deploy to AWS S3 | |
env: | |
BUCKET_NAME: ${{ secrets.AWS_S3_BUCKET_NAME }} | |
run: | | |
aws s3 rm s3://$BUCKET_NAME/assets/ --recursive | |
aws s3 sync ./dist s3://$BUCKET_NAME | |
- name: CloudFront Invalidation | |
env: | |
CLOUD_FRONT_ID: ${{ secrets.AWS_CLOUDFRONT_ID }} | |
run: aws cloudfront create-invalidation --distribution-id $CLOUD_FRONT_ID --paths /* |