Skip to content

Commit

Permalink
Update deploy.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
son-daehyeon authored Aug 22, 2024
1 parent bd1421f commit 44b8f7a
Showing 1 changed file with 2 additions and 17 deletions.
19 changes: 2 additions & 17 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ env:
FRONTEND_IMAGE: ${{ secrets.DOCKERHUB_USERNAME }}/wink-official-frontend:${{ github.ref_name }}
BACKEND_IMAGE: ${{ secrets.DOCKERHUB_USERNAME }}/wink-official-backend:${{ github.ref_name }}

REMOTE_ARCHITECTURE: ${{ secrets.REMOTE_ARCHITECTURE }}

SSH_HOST: ${{ github.ref_name == 'master' && secrets.SSH_MASTER_HOST || secrets.SSH_DEVELOP_HOST }}
SSH_USERNAME: ${{ github.ref_name == 'master' && secrets.SSH_MASTER_USERNAME || secrets.SSH_DEVELOP_USERNAME }}
SSH_KEY: ${{ github.ref_name == 'master' && secrets.SSH_MASTER_KEY || secrets.SSH_DEVELOP_KEY }}
Expand Down Expand Up @@ -196,26 +194,13 @@ jobs:
runs-on: ubuntu-latest
needs: [ build-frontend-amd64, build-backend-amd64 ]
steps:
- name: Pull repository
uses: appleboy/ssh-action@v1.0.3
with:
host: ${{ env.SSH_HOST }}
username: ${{ env.SSH_USERNAME }}
key: ${{ env.SSH_KEY }}
script: |
cd wink-official-deploy
[ "$(git symbolic-ref --short HEAD)" != "${{ github.ref_name }}" ] && git checkout ${{ github.ref_name }}
git pull origin ${{ github.ref_name }}
- name: Deploy
uses: appleboy/ssh-action@v1.0.3
env:
DOCKER_COMPOSE_FILE: docker-compose-${{ github.ref_name }}-${{ env.REMOTE_ARCHITECTURE }}.yaml
with:
host: ${{ env.SSH_HOST }}
username: ${{ env.SSH_USERNAME }}
key: ${{ env.SSH_KEY }}
script: |
cd wink-official-deploy
docker compose -f ${{ env.DOCKER_COMPOSE_FILE }} pull
docker compose -f ${{ env.DOCKER_COMPOSE_FILE }} up -d
docker compose pull
docker compose up -d

0 comments on commit 44b8f7a

Please sign in to comment.