Merge branch 'fe-dev' of https://github.com/woowacourse-teams/2024-ha⦠#1
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: frontend-dev-deploy | |
on: | |
push: | |
branches: ["fe-dev"] | |
paths: | |
- "client/**" | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash | |
working-directory: ./client | |
steps: | |
# 1. Git 리ν¬μ§ν 리 체ν¬μμ | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
# 2. Node.js 20.15.1 versionμΌλ‘ μ ν | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "20.15.1" | |
# 3. μμ‘΄μ± μ€μΉ | |
- name: Install Dependencies | |
run: npm install | |
# 4. Dev νκ²½μΌλ‘ λΉλ | |
- name: Build for Dev environment | |
run: npm run build-dev | |
env: | |
API_BASE_URL: ${{ secrets.API_BASE_URL }} | |
AMPLITUDE_KEY: ${{ secrets.AMPLITUDE_KEY }} | |
KAKAO_JAVASCRIPT_KEY: ${{ secrets.KAKAO_JAVASCRIPT_KEY }} | |
IMAGE_URL: ${{ secrets.IMAGE_URL }} | |
KAKAO_REDIRECT_URI: ${{ secrets.KAKAO_REDIRECT_URI }} | |
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | |
# 5. AWS μΈμ¦ μ€μ | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v3 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: ${{ secrets.AWS_REGION }} | |
# 6. S3μ λΉλ κ²°κ³Ό μ λ‘λ | |
- name: Upload build results to S3 | |
run: aws s3 sync ./dist s3://${{ secrets.S3_BUCKET_NAME }}/dev/ --delete | |
# 7. CloudFront μΊμ 무ν¨ν | |
- name: Invalidate CloudFront Cache | |
run: | | |
aws cloudfront create-invalidation \ | |
--distribution-id ${{ secrets.DEV_CLOUDFRONT_DISTRIBUTION_ID }} \ | |
--paths "/*" |