generated from agiledev-students-fall2023/generic-project-repository
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
17 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |