rafactor: remove github pages actions #10
Workflow file for this run
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: Build & deploy in VPS | ||
name: test build | ||
on: | ||
push: | ||
branches: | ||
- main | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Use Node.js 20 | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: "20" | ||
- name: Install dependencies | ||
run: yarn install | ||
- name: Build | ||
run: yarn run build | ||
deploy: | ||
runs-on: ubuntu-latest | ||
needs: build | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Deploy using SSH | ||
uses: appleboy/ssh-action@master | ||
with: | ||
host: ${{ secrets.HOST }} | ||
username: ${{ secrets.USERNAME }} | ||
key: ${{ secrets.PRIVATE_KEY }} | ||
port: 22 | ||
script: | | ||
cd ~/website | ||
git pull origin main || { echo "Failed to pull latest changes from Git repository"; exit 1; } | ||
yarn install || { echo "Failed to install dependencies"; exit 1; } | ||
yarn run build || { echo "Build failed"; exit 1; } | ||
pm2 restart kuosc || { echo "Failed to restart PM2"; exit 1; } |