Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CD 수정, 아티팩터 다운로드 폴더 삭제 및 생성 #369

Merged
merged 1 commit into from
Aug 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 18 additions & 15 deletions .github/workflows/frontend_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,34 +14,33 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Setup Node.js
- name: Node.js 설정
uses: actions/setup-node@v4
with:
node-version: 20

- name: Create .env.production file
- name: .env.production 파일 생성
run: |
echo "REACT_APP_API_URL=${{ secrets.REACT_APP_API_URL }}" > ${{ env.frontend-directory }}/.env.production
echo "REACT_APP_BASE_URL=${{ secrets.REACT_APP_BASE_URL }}" >> ${{ env.frontend-directory }}/.env.production
echo "SENTRY_AUTH_TOKEN=${{ secrets.SENTRY_AUTH_TOKEN }}" >> ${{ env.frontend-directory }}/.env.production
echo "SENTRY_DSN=${{ secrets.SENTRY_DSN }}" >> ${{ env.frontend-directory }}/.env.production
echo "SENTRY_DSN=${{ secrets.SENTRY_AUTH_TOKEN }}" >> ${{ env.frontend-directory }}/.env.sentry-build-plugin

- name: Set environment file permissions
run: chmod 644 ${{ env.frontend-directory }}/.env.production

- name: Set Sentry environment file permissions
run: chmod 644 ${{ env.frontend-directory }}/.env.sentry-build-plugin
- name: 파일 접근 권한 변경
run: |
chmod 644 ${{ env.frontend-directory }}/.env.production
chmod 644 ${{ env.frontend-directory }}/.env.sentry-build-plugin

- name: Install Dependencies
- name: 의존성 설치
run: npm install
working-directory: ${{ env.frontend-directory }}

- name: Run Build
- name: 빌드 실행
run: npm run build
working-directory: ${{ env.frontend-directory }}

- name: Upload Artifact
- name: Artifact 업로드
uses: actions/upload-artifact@v4
with:
name: code-zap-front
Expand All @@ -51,14 +50,18 @@ jobs:
needs: build
runs-on: self-hosted
steps:
- name: Make Artifact Directory
run: mkdir ${{ secrets.FRONT_DIRECTORY }}
- name: Download Artifact
- name: Artifact 폴더 삭제 및 생성
run: |
rm -rf ${{ secrets.FRONT_DIRECTORY }}
mkdir ${{ secrets.FRONT_DIRECTORY }}

- name: Artifact 다운로드
uses: actions/download-artifact@v4
with:
name: code-zap-front
path: ${{ secrets.FRONT_DIRECTORY }}
- name: Move To S3

- name: 파일 S3로 이동
run: |
aws s3 cp --recursive ${{ secrets.FRONT_DIRECTORY }} s3://techcourse-project-2024/code-zap
rm -rf ${{ secrets.FRONT_DIRECTORY }}