ci-publish-test/.gitea/workflows/deplopy-dev.yaml
TomyJan 2a0fab5df6
All checks were successful
Build and deploy to dev server / Deploy (push) Successful in 1m9s
ci: test
2024-09-04 15:04:50 +08:00

41 lines
1.1 KiB
YAML

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:
node-version: 20.16.0
registry-url: ${{ vars.REGISTRY_URL }}
cache: 'pnpm'
- name: Install deps
run: pnpm install
- name: Build
run: pnpm build
- name: Change apt source
run: sudo sed -i 's@//.*archive.ubuntu.com@//mirrors.ustc.edu.cn@g' /etc/apt/sources.list
- name: Deploy to Server
uses: https://git.daoyoucloud.com/TomyJan/easingthemes-ssh-deploy@v5.1.1
env:
SSH_PRIVATE_KEY: ${{ secrets.DEV_SERVER_SSH_KEY }}
ARGS: '-rltgoDzvO --delete'
SOURCE: dist
REMOTE_HOST: '192.168.0.19'
REMOTE_USER: root
TARGET: /var/www/test/