Skip to content
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

[BugFix] CD 과정에서 .env에 환경 변수가 계속해서 누적되고 있던 문제 해결 #160

Merged
merged 1 commit into from
Nov 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"

Loading