Refactor EditProfileForm component and useUserProfile hook (#185) #372
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 | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Use Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '20' | |
- name: Install dependencies | |
run: npm ci | |
- name: Unit tests | |
run: npm run test | |
- name: ESLint check | |
run: npm run lint | |
- name: Build | |
run: npm run build | |
deploy: | |
if: github.event_name == 'push' | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Deploy to server | |
env: | |
SERVER_PASSWORD: ${{ secrets.SERVER_PASSWORD }} | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y sshpass | |
sshpass -p "$SERVER_PASSWORD" ssh -o StrictHostKeyChecking=no [email protected] << 'EOF' | |
cd scholarx-frontend | |
git pull | |
npm install | |
npm run build | |
sudo cp -r dist/* /var/www/scholarx/ | |
sudo systemctl restart nginx | |
EOF |