Update README.md #21
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: Deploy Frontend to Server | |
on: | |
push: | |
branches: | |
- master | |
workflow_dispatch: | |
jobs: | |
deploy-frontend: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18' | |
- name: Install dependencies and build frontend | |
run: | | |
cd frontend | |
npm install | |
npm run build | |
- name: Set up SSH | |
uses: webfactory/[email protected] | |
with: | |
ssh-private-key: ${{ secrets.DEPLOY_KEY }} | |
- name: Deploy frontend to server | |
run: | | |
# Transfer build folder directly to the server | |
scp -o StrictHostKeyChecking=no -r ./frontend/build/* [email protected]:/var/www/html/windprofilecalculator | |
scp -o StrictHostKeyChecking=no -r ./backend* [email protected]:/home/mason/WPCBackend | |