-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (53 loc) · 1.6 KB
/
release.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
name: Release Pipeline
on:
release:
types:
- published
jobs:
trigger-production-server:
if: github.event.release.prerelease == false
name: Restart Production Server for Rebuilding
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20'
- name: Install dependencies
run: npm ci
- name: Build Svelte app
run: npm run build
- name: Test Svelte app
run: npm run test
- name: Prepare for Production
run: |
rm -rf node_modules
rm -rf .git
rm -rf .github
rm -rf .vscode
rm -rf .gitignore
rm -rf src
rm -rf static
rm -rf .svelte-kit
- name: Deploy to Production Server with sftp
uses: wangyucode/[email protected]
with:
host: ${{secrets.PRODUCTION_HOST}}
port: ${{secrets.PRODUCTION_PORT}}
username: ${{ secrets.PRODUCTION_USERNAME }}.${{secrets.PANEL_SERVER_ID}}
password: ${{ secrets.PRODUCTION_PASSWORD }}
privateKey:
passphrase:
localDir: ./
remoteDir: /
removeExtraFilesOnServer: true
exclude: '.env'
- name: Send Restart
uses: outsparkled/[email protected]
with:
panel-url: ${{ secrets.PANEL_URL }}
server-id: ${{ secrets.PANEL_DEV_SERVER_ID }}
bearer-token: ${{ secrets.PANEL_BEARER_TOKEN }}
power-action: 'restart'