Skip to content

Merge pull request #135 from BUAA-SE-coders007/chore/improve #79

Merge pull request #135 from BUAA-SE-coders007/chore/improve

Merge pull request #135 from BUAA-SE-coders007/chore/improve #79

Workflow file for this run

name: Deploy to Server
on:
push:
branches:
- main
- dev
jobs:
deploy:
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 22.x
- name: Updata Npm
run: npm install -g npm@latest
- name: Install dependencies
run: npm install
- name: Build project
run: npm run build
- name: Deploy to Server
uses: appleboy/scp-action@v0.1.7
with:
host: ${{ secrets.REMOTE_HOST }}
username: ${{ secrets.REMOTE_USER }}
key: ${{ secrets.SERVER_SSH_KEY }}
port: 22
source: ./dist/*
target: /var/www/html/jienote/
- name: Set permissions on server
uses: appleboy/ssh-action@v0.1.7
with:
host: ${{ secrets.REMOTE_HOST }}
username: ${{ secrets.REMOTE_USER }}
key: ${{ secrets.SERVER_SSH_KEY }}
port: 22
script: |
sudo chown -R www-data:www-data /var/www/html/jienote
sudo chmod -R 755 /var/www/html/jienote