Skip to content

upd. gh action

upd. gh action #10

Workflow file for this run

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