-
Notifications
You must be signed in to change notification settings - Fork 1
[Deploy] PR preview url 생성 workflows 구축 #174
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
Merged
The head ref may contain hidden characters: "173-deploy-pr-\uBBF8\uB9AC\uBCF4\uAE30-url-\uC790\uB3D9-\uC0DD\uC131-\uC6CC\uD06C\uD50C\uB85C\uC6B0-\uAD6C\uCD95"
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
45ab8e1
Deploy: PR preview url 생성 workflows 구축
miraclee1226 740e6e5
Fix: pnpm 설치를 Node.js 설정 전으로 변경
miraclee1226 38be2ab
Fix: pnpm/action-setup 액션의 version을 package.json의 packageManager 버전과 일치
miraclee1226 c8341a6
Fix: packageManager 버전 pnpm@9.12.1로 수정
miraclee1226 9ca9659
Fix: pnpm 버전 일치시킴
miraclee1226 eabffac
Refactor: 전체 경로 무효화에서 특정 경로 무효화로 변경
miraclee1226 c7e3ca8
Deploy: AWS Credentials 액션 버전 업데이트
miraclee1226 6af2a1e
Fix: pnpm version 수정
miraclee1226 ccd7332
Chore: workspaces 추가
miraclee1226 48b5da6
Chore: --frozen-lockfile 삭제
miraclee1226 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| name: preview-url | ||
|
|
||
| permissions: | ||
| pull-requests: write | ||
| contents: read | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: [develop] | ||
|
|
||
| jobs: | ||
| preview: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Git Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Install pnpm | ||
| uses: pnpm/action-setup@v4 | ||
| with: | ||
| version: 8.15.6 | ||
|
|
||
| - name: Use Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: "20.x" | ||
| cache: "pnpm" | ||
|
|
||
| - name: Install dependencies | ||
| run: pnpm install | ||
|
|
||
| - name: Generate Environment Variables File | ||
| run: | | ||
| echo "NEXT_PUBLIC_API_URL=$NEXT_PUBLIC_API_URL" >> apps/web/.env.production.local | ||
| env: | ||
| NEXT_PUBLIC_API_URL: ${{ secrets.NEXT_PUBLIC_API_URL }} | ||
|
|
||
| - name: Build | ||
| run: pnpm -filter=web 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: ${{ secrets.AWS_REGION }} | ||
|
|
||
| - name: Deploy to S3 with PR-specific prefix | ||
| run: aws s3 sync ./${{ secrets.BUILD_DIRECTORY }} s3://${{ secrets.AWS_S3_BUCKET_NAME }}/pr-${{ github.event.pull_request.number }} --delete | ||
|
|
||
| - name: CloudFront Invalidate Cache | ||
| run: aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_CLOUDFRONT_DISTRIBUTION_ID }} --paths "/pr-${{ github.event.pull_request.number }}/*" | ||
|
|
||
| - name: Add Preview URL as a Comment | ||
| uses: marocchino/sticky-pull-request-comment@v2 | ||
| with: | ||
| message: | | ||
| ## 🚀 Preview URL | ||
|
|
||
| **Branch:** ${{ github.head_ref }} | ||
| **Commit:** ${{ github.sha }} | ||
|
|
||
| Preview URL: https://codeit.click?pr=${{ github.event.pull_request.number }} | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.