This repository has been archived by the owner on Nov 16, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
80 lines (69 loc) · 2.2 KB
/
cd.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
75
76
77
78
79
80
name: CD
on:
workflow_dispatch:
inputs:
deployEnvironment:
description: 'Deployment Environment'
required: true
default: 'demo'
jobs:
build_ione_admin_ui:
runs-on: ubuntu-latest
environment:
name: ${{ github.event.inputs.deployEnvironment }}
defaults:
run:
working-directory: ./ui
steps:
- uses: actions/checkout@v4
- uses: actions/[email protected]
- name: Dependencies
run: npm install
- name: Build
env:
VUE_APP_IONE_API_BASE_URL: ${{ secrets.IONE_API_BASE_URL }}
run: npm run build
- name: SFTP Deploy
uses: wlixcc/[email protected]
with:
username: ${{ secrets.SFTP_USER }}
server: ${{ secrets.SFTP_HOST }}
port: ${{ secrets.SFTP_PORT }}
ssh_private_key: ${{ secrets.SFTP_PRIVATE_KEY }}
local_path: ui/dist
remote_path: /usr/lib/one/ione/ui
upgrade_ione:
runs-on: ubuntu-latest
environment:
name: ${{ github.event.inputs.deployEnvironment }}
steps:
- uses: actions/checkout@v4
- name: Remove unwanted dirs and files
run: rm -rf docs modules ui
- name: Upload codebase
uses: appleboy/scp-action@master
with:
username: ${{ secrets.SFTP_USER }}
host: ${{ secrets.SFTP_HOST }}
port: ${{ secrets.SFTP_PORT }}
key: ${{ secrets.SFTP_PRIVATE_KEY }}
source: "./*"
target: /usr/lib/one/ione
- name: Install gems, set hooks, upgrade service file and restart
uses: appleboy/ssh-action@master
with:
username: ${{ secrets.SFTP_USER }}
host: ${{ secrets.SFTP_HOST }}
port: ${{ secrets.SFTP_PORT }}
key: ${{ secrets.SFTP_PRIVATE_KEY }}
script: |
cd /usr/lib/one/ione
chmod +x ione_server.rb
chmod +x -R hooks/*
rake hooks
rake install_deps[yum, y]
\cp -f sys/ione.service /usr/lib/systemd/system/ione.service
systemctl daemon-reload
systemctl restart ione
sleep 10
systemctl is-active ione