-
Notifications
You must be signed in to change notification settings - Fork 8
60 lines (47 loc) · 1.33 KB
/
deploy.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
name: Deploy
on:
push:
branches: [main]
env:
VITE_API_URL: ${{ vars.API_URL }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js 22.X
uses: actions/setup-node@v4
with:
node-version: 22.X
cache: npm
- name: Install dependencies
run: npm install
- name: Lint
run: npm run lint
- name: Build
run: npm run build
- name: Replace symlinks by the targeted file
run: find ./dist -type l -exec sh -c 'cp --remove-destination "$(readlink "{}")" "{}"' \;
- uses: actions/upload-artifact@v4
with:
name: website
path: ./dist/
deploy:
runs-on: ubuntu-latest
needs: build
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: website
- name: Upload to SFTP
uses: wangyucode/[email protected]
with:
host: ${{ secrets.UPLOAD_SFTP_HOST }}
username: ${{ secrets.UPLOAD_SFTP_USERNAME }}
password: ${{ secrets.UPLOAD_SFTP_PASSWORD }}
compress: true
localDir: ${{ github.workspace }}
remoteDir: ${{ secrets.UPLOAD_SFTP_DIRECTORY }}
exclude: "/api/,/.htaccess"
removeExtraFilesOnServer: true