@@ -124,7 +124,7 @@ jobs:
124124 host : ${{ secrets.SERVER_HOST }}
125125 username : root
126126 password : ${{ secrets.SERVER_PASSWORD }}
127- source : " docker-compose.yml,nginx/nginx.conf,nginx/proxy.conf"
127+ source : " docker-compose.yml,nginx/nginx.conf.template ,nginx/proxy.conf"
128128 target : " ~/retoday"
129129 overwrite : true
130130
@@ -133,15 +133,19 @@ jobs:
133133 env :
134134 DOCKER_USER : ${{ secrets.DOCKERHUB_USERNAME }}
135135 SHA : ${{ needs.build-and-push.outputs.sha }}
136+ DOMAIN : dev.re-today.com
136137 with :
137138 host : ${{ secrets.SERVER_HOST }}
138139 username : root
139140 password : ${{ secrets.SERVER_PASSWORD }}
140- envs : DOCKER_USER,SHA
141+ envs : DOCKER_USER,SHA,DOMAIN
141142 script : |
142143 set -e
143144 cd ~/retoday
144145
146+ export DOMAIN="${DOMAIN}"
147+ envsubst '${DOMAIN}' < nginx/nginx.conf.template > nginx/nginx.conf
148+
145149 docker pull ${DOCKER_USER}/retoday-api:${SHA}
146150 docker tag ${DOCKER_USER}/retoday-api:${SHA} retoday-api:latest
147151 COMPOSE_PROFILES=dev docker compose up -d --force-recreate api
@@ -212,7 +216,7 @@ jobs:
212216 host : ${{ secrets.SERVER_HOST }}
213217 username : root
214218 password : ${{ secrets.SERVER_PASSWORD }}
215- source : " docker-compose.yml,nginx/nginx.conf,nginx/proxy.conf"
219+ source : " docker-compose.yml,nginx/nginx.conf.template ,nginx/proxy.conf"
216220 target : " ~/retoday"
217221 overwrite : true
218222
@@ -221,15 +225,19 @@ jobs:
221225 env :
222226 DOCKER_USER : ${{ secrets.DOCKERHUB_USERNAME }}
223227 SHA : ${{ needs.build-and-push.outputs.sha }}
228+ DOMAIN : api.re-today.com
224229 with :
225230 host : ${{ secrets.SERVER_HOST }}
226231 username : root
227232 password : ${{ secrets.SERVER_PASSWORD }}
228- envs : DOCKER_USER,SHA
233+ envs : DOCKER_USER,SHA,DOMAIN
229234 script : |
230235 set -e
231236 cd ~/retoday
232237
238+ export DOMAIN="${DOMAIN}"
239+ envsubst '${DOMAIN}' < nginx/nginx.conf.template > nginx/nginx.conf
240+
233241 # 활성 컨테이너 확인
234242 if grep -q "api-blue" nginx/upstream.conf; then
235243 CURRENT="blue"; TARGET="green"
0 commit comments