ci-publish-test/.gitea/workflows/deplopy-dev.yaml

39 lines
966 B
YAML
Raw Normal View History

2024-09-04 11:50:39 +08:00
name: Build and deploy to dev server
on:
push:
workflow_dispatch:
permissions:
contents: write
env:
npm_config_registry: ${{ vars.REGISTRY_URL }}
jobs:
Deploy:
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup pnpm
uses: pnpm/action-setup@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
2024-09-04 14:41:27 +08:00
node-version: 20.16.0
2024-09-04 14:36:31 +08:00
registry-url: ${{ vars.REGISTRY_URL }}
2024-09-04 11:50:39 +08:00
cache: 'pnpm'
- name: Install deps
run: pnpm install
- name: Build
run: pnpm build
- name: Deploy to Server
2024-09-04 12:45:21 +08:00
uses: https://git.daoyoucloud.com/TomyJan/easingthemes-ssh-deploy@v5.1.1
2024-09-04 11:50:39 +08:00
env:
SSH_PRIVATE_KEY: ${{ secrets.SERVER_SSH_KEY }}
ARGS: '-rltgoDzvO --delete'
2024-09-04 11:52:08 +08:00
SOURCE: dist
REMOTE_HOST: '192.168.0.19'
REMOTE_USER: root
TARGET: /var/www/test/