updated github actions #1
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
name: CI/CD Pipeline | |
on: | |
push: | |
branches: | |
- cicd | |
pull_request: | |
branches: | |
- cicd | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Node.js (for front-end) | |
uses: actions/setup-node@v2 | |
with: | |
node-version: "18" | |
- name: Install front-end dependencies | |
run: | | |
cd front-end | |
npm install | |
- name: Install back-end dependencies | |
run: | | |
cd back-end | |
npm install | |
- name: List contents of the models directory | |
run: ls -l ./back-end/models/ | |
# - name: Run back-end tests | |
# run: | | |
# cd back-end | |
# npm test | |
# - name: Build and run Docker containers | |
# run: docker-compose up --build | |
- name: Deploy React and Express App | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.DROPLET_IP }} | |
key: ${{ secrets.SSH_PRIVATE_KEY }} | |
username: ${{ secrets.SSH_USER }} | |
script: | | |
cd 4-final-project-group-bill-splitting-app | |
git pull | |
cd front-end | |
npm install | |
npm start | |
cd ../back-end | |
npm install | |
npm start | |
echo 'Success' |