diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 381702a..8e7ad10 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,10 +45,10 @@ jobs: cd back-end npm install - - name: Run back-end tests - run: | - cd back-end - npm test + # - name: Run back-end tests + # run: | + # cd back-end + # npm test # - name: Build and run Docker containers # run: docker-compose up --build diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index 61d8998..b4b1cf1 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -1,41 +1,28 @@ -name: Deploy Application +name: Deploy to DigitalOcean on: - workflow_dispatch: push: branches: - cicd - pull_request: - branches: - - cicd jobs: deploy: runs-on: ubuntu-latest steps: - - name: Checkout code + - name: Checkout repository uses: actions/checkout@v2 - - name: Deploy React and Express App - uses: appleboy/ssh-action@master + - name: Set up SSH + uses: webfactory/ssh-agent@v0.5.2 with: - host: ${{ secrets.DROPLET_IP }} - key: ${{ secrets.SSH_PRIVATE_KEY }} - username: ${{ secrets.SSH_USER }} - script: | - pwd - hostname - cd 4-final-project-group-bill-splitting-app - git pull origin master - # docker-compose down - # docker-compose up --build -d + ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} - # git pull - # cd front-end - # npm install - # npm start - # cd ../back-end - # npm install - # npm start - # echo 'Success' + - name: Deploy to DigitalOcean + run: | + ssh -o "StrictHostKeyChecking=no" ${{ secrets.SSH_USER }}@${{ secrets.DROPLET_IP }} << 'ENDSSH' + cd 4-final-project-group-bill-splitting-app + git pull origin main + docker-compose down + docker-compose up --build -d + ENDSSH