upd. gh action #10
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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@v4 | |
# - 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@v4.3.5 | |
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 |