[초기세팅] PR 미리보기 액션 수정 #3
Workflow file for this run
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: pr-preview | |
on: | |
# main, develop 브랜치를 향해 PR 올리면 임시 배포되도록 설정 | |
pull_request: | |
types: | |
- opened | |
- reopened | |
- synchronize | |
branches: [main, develop] | |
# 권한 설정 | |
permissions: | |
contents: write | |
issues: write | |
pull-requests: write | |
id-token: write | |
pages: write | |
deployments: write | |
# 동시성 설정 | |
concurrency: preview-${{ github.ref }} | |
jobs: | |
deploy-preview: | |
runs-on: ubuntu-latest | |
steps: | |
# workflow에 속한 레포지토리에 접근할 수 있도록 설정 | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- run: echo "PREVIEW_PATH=pr-preview/pr-${{ github.event.number }}" >> "$GITHUB_ENV" | |
# 종속성 설치 및 프로젝트 빌드 | |
- name: Install and Build | |
run: yarn install && yarn build | |
# PR 프리뷰 배포 | |
- name: Deploy PR Preview | |
uses: rossjrw/[email protected] | |
with: | |
token: ${{ secrets.TOKEN}} | |
source-dir: ./dist/ | |
preview-branch: gh-pages | |
umbrella-dir: pr-preview | |
action: auto |