Skip to content

Commit

Permalink
fix: current_state 읽어 오는 과정 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
flydog98 committed Dec 18, 2023
1 parent 7175aed commit 89f6c11
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions .github/workflows/backend-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,13 @@ jobs:
password: ${{ secrets.NGINX_SSH_PASSWORD }}
port: ${{ secrets.NGINX_SSH_PORT }}
script: |
CURRENT_STATE=$(cat /status)
echo "cur staate is $CURRENT_STATE"
echo "::set-output name=CURRENT_STATE::$CURRENT_STATE"
scp ${{ secrets.NGINX_SSH_USERNAME }}@${{ secrets.NGINX_SSH_HOST }}:/status ./status
- name: Read Status File
id: read-status
run: |
CURRENT_STATE=$(cat ./status)
echo "CURRENT_STATE=$CURRENT_STATE" >> $GITHUB_ENV
- name: SSH and Deploy
uses: appleboy/ssh-action@master
Expand All @@ -79,9 +83,9 @@ jobs:
password: ${{ secrets.BACKEND_SSH_PASSWORD }}
port: ${{ secrets.BACKEND_SSH_PORT }}
script: |
echo "The current state is ${{ steps.get-state.outputs.CURRENT_STATE }}"
echo "The current state is ${{ env.CURRENT_STATE }}"
docker pull ${{ secrets.DOCKERHUB_USERNAME }}/git-challenge-backend:0.1
if [ ${{ steps.get-state.outputs.CURRENT_STATE }} = "blue" ]; then
if [ ${{ env.CURRENT_STATE }} = "blue" ]; then
docker run -d --name backend-green -p 8081:8080 \
-v /${{ secrets.BACKEND_SSH_USERNAME }}/backend-logs:/app/packages/backend/logs/ \
-e CONTAINER_GIT_USERNAME=${{ secrets.CONTAINER_GIT_USERNAME }} \
Expand Down

0 comments on commit 89f6c11

Please sign in to comment.