Files
portfolio/.github/workflows/deploy.yml
2024-06-20 12:06:40 +02:00

36 lines
805 B
YAML

name: Deploy to server
on:
push:
branches:
- main
- master
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: '18'
- name: Install dependencies and build
run: |
npm ci
npm run build
- name: Copy build directory to server
uses: appleboy/scp-action@master
with:
host: ${{ secrets.SERVER_HOST }}
username: ${{ secrets.SERVER_USERNAME }}
password: ${{ secrets.SERVER_PASSWORD }}
port: ${{ secrets.SERVER_PORT }}
source: "build/*"
target: ${{ secrets.SERVER_DIRECTORY }}
protocol: sftp