Skip to content

Commit

Permalink
cd
Browse files Browse the repository at this point in the history
  • Loading branch information
Allison67 committed Dec 6, 2023
1 parent 5351891 commit b686fb4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 30 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
39 changes: 13 additions & 26 deletions .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
@@ -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-[email protected]
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

0 comments on commit b686fb4

Please sign in to comment.