diff --git a/.github/workflows/CD.yml b/.github/workflows/CD.yml index 705a52b..00471b6 100644 --- a/.github/workflows/CD.yml +++ b/.github/workflows/CD.yml @@ -23,6 +23,7 @@ jobs: uses: docker/build-push-action@v2 with: context: . + file: ./Dockerfile push: true tags: ${{ secrets.DOCKER_USERNAME }}/backend:latest build-args: | @@ -34,9 +35,8 @@ jobs: - name: Set environment variables run: | - echo "MYSQL_DATABASE=${{ secrets.DB_NAME }}" > .env - echo "MYSQL_ROOT_PASSWORD=${{ secrets.DB_PASSWORD }}" >> .env + echo "MYSQL_ROOT_PASSWORD=${{ secrets.MYSQL_ROOT_PASSWORD }}" >> .env - name: Deploy Application uses: appleboy/ssh-action@v1.0.3 @@ -45,14 +45,11 @@ jobs: username: ${{ secrets.REMOTE_USERNAME }} key: ${{ secrets.REMOTE_KEY }} script: | - echo "### Change directory to Sasimee-Back ###" - cd /home/ubuntu/Backend + echo "### Change directory to Backend ###" + cd /home/***/Backend echo "### Pull origin main from github ###" - git pull origin main - - echo "### Pull new image from dockerhub###" - sudo docker compose build backend + git pull origin actions echo "### Shutdown existing container ###" sudo docker compose down