feat/markup/landing-page/DEVING-78 #98
Workflow file for this run
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
| name: Netlify PR Preview | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| permissions: | |
| contents: read | |
| jobs: | |
| deploy-preview: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: '18' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Create .env file | |
| run: | | |
| echo "NEXT_PUBLIC_API_URL=${{ secrets.NEXT_PUBLIC_API_URL }}" >> .env | |
| echo "NEXT_TOKEN_MAX_AGE=${{ secrets.NEXT_TOKEN_MAX_AGE }}" >> .env | |
| - name: Build project | |
| run: npm run build | |
| # netlify-cli를 사용하여 배포 | |
| - name: Install Netlify CLI | |
| run: npm install -g netlify-cli | |
| # PR에 대한 미리보기 배포 | |
| - name: Deploy Preview to Netlify | |
| run: netlify deploy --build --alias=pr-${{ github.event.number }} | |
| env: | |
| NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} | |
| NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} |