Skip to content

Commit

Permalink
fix: CD workflow에 기존 .env 삭제 스크립트 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
yangchef1 committed Nov 26, 2024
1 parent 0ba52ca commit 50fa45c
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions .github/workflows/CD.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,27 +35,30 @@ jobs:
# NVM setup
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
# Install pnpm pm2
npm install -g pnpm
npm install -g pm2
# move to directory and pull latest changes
cd ../var/www/harmony
git pull origin dev
# Install dependencies
pnpm install
# Delete existing .env
rm apps/server/.env
rm apps/client/.env
# Add envs
echo "${{ secrets.SERVER_ENV }}" >> apps/server/.env
echo "${{ secrets.CLIENT_ENV }}" >> apps/client/.env
# Build
pnpm build
# Restart pm2
pm2 restart apps/server/ecosystem.config.js --env production || pm2 start apps/server/ecosystem.config.js --env production
echo "Deployment Success"

0 comments on commit 50fa45c

Please sign in to comment.