diff --git a/.github/workflows/frontend.yml b/.github/workflows/frontend.yml index 02cf42b..a3757f0 100644 --- a/.github/workflows/frontend.yml +++ b/.github/workflows/frontend.yml @@ -2,6 +2,32 @@ name: CD +on: + push: + branches: [ main ] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + + - name: Checkout source code + uses: actions/checkout@v3 # workflow에서 액세스할 수 있도록 저장소를 체크아웃 + + - name: Create .env file + run: | + jq -r 'to_entries|map("\(.key)=\(.value|tostring)")|.[]' <<< "$SECRETS_CONTEXT" > .env + env: + SECRETS_CONTEXT: ${{ toJson(secrets) }} + + - name: Install dependencies + run: yarn install + + +name: CD + + on: push: branches: [ main ] @@ -27,8 +53,12 @@ jobs: - name: Install dependencies run: yarn install - - name: Build - run: yarn build + # 임시!! + - name: 리액트 빌드 무시 + run: CI='false' yarn build + + - name: S3 Deploy + run: aws s3 sync ./build s3://${{ secrets.AWS_S3_BUCKET }}/ --acl bucket-owner-full-control - name: Invalidate CloudFront Cache # 새로 리소스를 업데이트할 때 기존 캐시 무효화 uses: chetan/invalidate-cloudfront-action@master