modified server #5
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 for React.js inside 'frontend' folder | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '16' | |
# - name: Navigate to frontend and install dependencies | |
# run: | | |
# cd frontend | |
# npm install | |
# - name: Run tests | |
# run: | | |
# cd frontend | |
# npm test | |
# - name: Build React app | |
# run: | | |
# cd frontend | |
# npm run build | |
# - name: Print environment variables | |
# run: | | |
# echo "NO: ${{ secrets.NO }}" | |
# echo "Server IP: ${{ secrets.SERVER_IP }}" | |
# echo "Server Username: ${{ secrets.SERVER_USERNAME }}" | |
# - name: Deploy to server via SSH | |
# run: | | |
# ssh | |
# uses: appleboy/ssh-action@master | |
# with: | |
# host: ${{ secrets.SERVER_IP }} | |
# username: ${{ secrets.SERVER_USERNAME }} | |
# password: ${{ secrets.SERVER_PASSWORD }} | |
# script: | | |
# cd /home/cse-tech/ashu | |
# cd frontend | |
# git pull origin main | |
# npm install | |
# npm run build | |
# pm2 restart react-app |