-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (68 loc) · 2.25 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
name: Deploy App
"on":
push:
branches:
- main
# on:
# pull_request:
# branches:
# - main
jobs:
tests:
name: Deploy Process
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: "8.3"
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, redis
tools: composer:v2
coverage: none
- name: Decrypt large secret
run: cp .env.example .env && ./decrypt_secret.sh
env:
LARGE_SECRET_PASSPHRASE: ${{ secrets.CRENDENTIALS_PASSPHRASE }}
- name: Run composer install
run: composer install -n --prefer-dist -o
- name: Decrypt large env
run: cp .env.prod.gpg .env.gpg && ./decrypt_env.sh
env:
LARGE_SECRET_PASSPHRASE: ${{ secrets.CRENDENTIALS_PASSPHRASE }}
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: "20.x"
- name: Install dependencies
run: npm ci
- name: Build App
run: |
npm run build && \
rm -rf ./public/.htaccess
- uses: montudor/action-zip@v1
with:
args: zip -qq -r deploy/app.zip ./ -x ".git/*"
- uses: SamKirkland/[email protected]
with:
server: ${{ secrets.FTP_SERVER }}
username: ${{ secrets.FTP_USERNAME }}
password: ${{ secrets.FTP_PASSWORD }}
protocol: ${{ vars.PROTOCOL_FTP }}
local-dir: ./deploy/
log-level: verbose
timeout: 60000
- name: executing remote ssh commands using password
uses: appleboy/[email protected]
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USERNAME }}
password: ${{ secrets.SSH_PASSWORD }}
port: ${{ secrets.SSH_PORT }}
script: |
cd /home/${{ secrets.SSH_USERNAME }}/stepcash
rm -rf public/build
unzip -o app.zip -d /home/${{ secrets.SSH_USERNAME }}/stepcash/
rm -rf app.zip
/opt/alt/php83/usr/bin/php artisan optimize
/opt/alt/php83/usr/bin/php artisan filament:optimize