34 lines
833 B
YAML
34 lines
833 B
YAML
name: Build and Deploy
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install dependencies and build
|
|
run: |
|
|
echo "Current directory: $(pwd)"
|
|
echo "GitHub workspace: $GITHUB_WORKSPACE"
|
|
ls -la
|
|
docker run --rm -v "$GITHUB_WORKSPACE:/app" -w /app node:20 sh -c "ls -la && npm install --registry=https://registry.npmmirror.com && npm run build"
|
|
|
|
- name: Deploy to server
|
|
uses: appleboy/scp-action@v0.1.7
|
|
with:
|
|
host: baishe.honor3.com
|
|
port: 22
|
|
username: root
|
|
password: ${{ secrets.SSH_PWD }}
|
|
source: "dist/*"
|
|
target: "/app/staticwebs/seckit"
|