Skip to content

chore: code rabbit - base branch설정 #289

chore: code rabbit - base branch설정

chore: code rabbit - base branch설정 #289

Workflow file for this run

name: CICD Web
on:
- push
- pull_request
jobs:
build-web:
runs-on: ubuntu-22.04
env:
WEB_URL: "${{ github.ref == 'refs/heads/develop' && secrets.STAGING_WEB_URL || secrets.PROD_WEB_URL }}"
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
- name: Web Build
run: npm install --global vercel@latest
- name: setting environment variables
run: |
echo "${{ secrets.SHARED_ENV_FILE }}" >> packages/shared/.env
echo WEB_URL=${{ env.WEB_URL }} >> packages/shared/.env
echo "${{ secrets.WEB_ENV_FILE }}" > packages/web/.env
echo NEXT_PUBLIC_WEB_URL=${{ env.WEB_URL }} >> packages/web/.env
- name : Vercel Pull
run: vercel pull --yes --token=${{ secrets.VERCEL_TOKEN }}
- name: Vercel Build
run: vercel build --token=${{ secrets.VERCEL_TOKEN }}
- name: Deploy staging when push on develop branch
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/develop'}}
run: |
VERCEL_DEPOLYED_URL="$(vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }})"
vercel alias set "$VERCEL_DEPOLYED_URL" ${{secrets.STAGING_WEB_URL_WITHOUT_PROTOCOL}} --token=${{ secrets.VERCEL_TOKEN }} --scope=gueit214s-projects
- name: Deploy production when push on master branch
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master'}}
run: |
VERCEL_DEPOLYED_URL="$(vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }})"
vercel --prod --token=${{ secrets.VERCEL_TOKEN }}