Skip to content

Deploy Frontend to Server #12

Deploy Frontend to Server

Deploy Frontend to Server #12

name: Deploy Frontend to Server
on:
workflow_dispatch: # Allows manual triggering of the workflow
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' # Adjust Node.js version as needed
- 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