-
Notifications
You must be signed in to change notification settings - Fork 0
115 lines (99 loc) · 3.43 KB
/
deploy-demos.yaml
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
name: Deploy demo sites
on:
workflow_dispatch:
push:
branches:
- main
concurrency: demo_environment
jobs:
deploy:
name: 🚀 Deploy demo sites
runs-on: ubuntu-latest
strategy:
fail-fast: false
max-parallel: 1
matrix:
config: [fnf]
include:
- config: fnf
uname_secret: DB_USERNAME_FNF
pword_secret: DB_PASSWORD_FNF
app_name: FNF
steps:
- name: 🚚 Get latest code
uses: actions/checkout@v3
# - uses: shivammathur/setup-php@v2
# with:
# php-version: latest
# - uses: ramsey/composer-install@v2
# with:
# composer-options: --no-dev --no-scripts --optimize-autoloader
- name: ✏️ Replace APP_NAME
uses: jacobtomlinson/gha-find-replace@v3
with:
include: "config/app.php"
regex: false
find: "env('APP_NAME', 'OCAP OData API')"
replace: "env('APP_NAME', '${{ matrix.app_name }} OData API')"
- name: ✏️ Replace APP_OCAP_STATS_URL
uses: jacobtomlinson/gha-find-replace@v3
with:
include: "config/app.php"
regex: false
find: "env('APP_OCAP_STATS_URL', null)"
replace: "env('APP_OCAP_STATS_URL', 'https://${{ matrix.config }}-stats.devs.space/')"
- name: ✏️ Replace APP_URL
uses: jacobtomlinson/gha-find-replace@v3
with:
include: "config/app.php"
regex: false
find: "env('APP_URL', 'http://localhost:8500')"
replace: "env('APP_URL', 'https://${{ matrix.config }}-odata.devs.space/')"
- name: ✏️ Replace APP_KEY
uses: jacobtomlinson/gha-find-replace@v3
with:
include: "config/app.php"
regex: false
find: "env('APP_KEY')"
replace: "env('APP_KEY', '${{ secrets.APP_KEY }}')"
- name: ✏️ Replace DB_DATABASE
uses: jacobtomlinson/gha-find-replace@v3
with:
include: "config/database.php"
regex: false
find: "env('DB_DATABASE', 'ocapstats')"
replace: "env('DB_DATABASE', '${{ secrets[matrix.uname_secret] }}')"
- name: ✏️ Replace DB_USERNAME
uses: jacobtomlinson/gha-find-replace@v3
with:
include: "config/database.php"
regex: false
find: "env('DB_USERNAME', 'root')"
replace: "env('DB_USERNAME', '${{ secrets[matrix.uname_secret] }}')"
- name: ✏️ Replace DB_PASSWORD
uses: jacobtomlinson/gha-find-replace@v3
with:
include: "config/database.php"
regex: false
find: "env('DB_PASSWORD', 'rootpass')"
replace: "env('DB_PASSWORD', '${{ secrets[matrix.pword_secret] }}')"
- name: ✏️ Replace LODATA_DISCOVERY_TTL
uses: jacobtomlinson/gha-find-replace@v3
with:
include: "config/lodata.php"
regex: false
find: "env('LODATA_DISCOVERY_TTL', 0)"
replace: "env('LODATA_DISCOVERY_TTL', 300)"
- name: 📂 Sync files
uses: SamKirkland/FTP-Deploy-Action@4.3.3
with:
server: "${{ secrets.FTP_HOSTNAME }}"
username: "${{ secrets.FTP_USERNAME }}"
password: "${{ secrets.FTP_PASSWORD }}"
server-dir: "${{ matrix.config }}-odata/"
exclude: |
**/.git*
**/.git*/**
.runtime/**
artisan
docker-compose.yml