Skip to content

Commit

Permalink
fix: 타임아웃 설정
Browse files Browse the repository at this point in the history
  • Loading branch information
khee2 committed Aug 1, 2024
1 parent 29bde28 commit 4b78507
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,18 @@ jobs:
username: ${{ secrets.SSH_USERNAME }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
script: |
cd ~/midpoint-backend && \
git pull origin main && \
docker pull ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_REPOSITORY }}:${{ github.sha }} && \
echo "POSTGRES_DB=${{ secrets.POSTGRES_DB }}" > .env && \
echo "POSTGRES_USER=${{ secrets.POSTGRES_USER }}" >> .env && \
echo "POSTGRES_PASSWORD=${{ secrets.POSTGRES_PASSWORD }}" >> .env && \
echo "DOCKER_IMAGE=${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_REPOSITORY }}:${{ github.sha }}" >> .env && \
docker-compose --env-file .env up -d
echo "Starting deployment..."
cd ~/midpoint-backend
echo "Pulling latest changes from main branch..."
git pull origin main
echo "Pulling latest Docker image..."
docker pull ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_REPOSITORY }}:${{ github.sha }}
echo "Setting environment variables..."
echo "POSTGRES_DB=${{ secrets.POSTGRES_DB }}" > .env
echo "POSTGRES_USER=${{ secrets.POSTGRES_USER }}" >> .env
echo "POSTGRES_PASSWORD=${{ secrets.POSTGRES_PASSWORD }}" >> .env
echo "DOCKER_IMAGE=${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_REPOSITORY }}:${{ github.sha }}" >> .env
echo "Starting Docker containers with docker-compose..."
docker-compose --env-file .env up -d
echo "Deployment completed successfully!"
timeout: 30m

0 comments on commit 4b78507

Please sign in to comment.