-
Notifications
You must be signed in to change notification settings - Fork 11
74 lines (65 loc) · 1.94 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: Deploy
on:
push:
branches:
- main
env:
TZ: Asia/Shanghai
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v4.1.1
with:
persist-credentials: false
fetch-depth: 0
- uses: pnpm/action-setup@v2
with:
version: 8
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "16.x"
registry-url: "https://registry.npmjs.org"
cache: "pnpm"
- name: Install deps
run: pnpm install
- name: Build
run: |
pnpm build:vite
- name: Deploy 🚀
uses: peaceiris/actions-gh-pages@v3.9.3
with:
github_token: ${{ secrets.ACCESS_TOKEN }}
publish_dir: dist
commit_message: ${{ github.event.head_commit.message }}
# keep_files: false
force_orphan: true
# - name: Deploy to Server 📂
# uses: SamKirkland/FTP-Deploy-Action@4.2.0
# with:
# server: ${{ secrets.FTP_SERVER }}
# username: ${{ secrets.FTP_USERNAME }}
# password: ${{ secrets.FTP_PASSWORD }}
# local-dir: ./dist/
# deploy-server:
# needs: build-and-deploy
# runs-on: ubuntu-latest
# steps:
# - name: Prepare SSH to work with the remote server
# run: |
# cd ~ && mkdir .ssh &&
# touch ~/.ssh/known_hosts &&
# echo "${{ secrets.SSH_HOSTKEY }}" > ~/.ssh/known_hosts
# - name: Deploy to Server
# uses: easingthemes/ssh-deploy@main
# env:
# SSH_PRIVATE_KEY: ${{ secrets.SERVER_SSH_KEY }}
# ARGS: "-rltgoDzvO --delete"
# SOURCE: "dist/"
# REMOTE_HOST: ${{ secrets.REMOTE_HOST }}
# REMOTE_PORT: ${{ secrets.REMOTE_PORT }}
# REMOTE_USER: ${{ secrets.REMOTE_USER }}
# TARGET: ${{ secrets.REMOTE_TARGET }}
# EXCLUDE: "/dist/, /node_modules/, ./.user.ini"