TIF_E41211320/.github/workflows/github.yml

43 lines
1.3 KiB
YAML

name: SPK_PM_DOSBING
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
jobs:
deploy:
name: deploy to staging
runs-on: ubuntu-latest
steps:
- uses: shivammathur/setup-php@15c43e89cdef867065b0213be354c2841860869e
with:
php-version: "8.2"
- uses: actions/checkout@v4
- name: Copy .env
run: php -r "file_exists('.env') || copy('.env.example', '.env');"
- name: Install Dependencies
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist --no-dev --optimize-autoloader --no-interaction --prefer-dist
- name: Generate key
run: php artisan key:generate
- name: Directory Permissions
run: chmod -R 777 storage bootstrap/cache
- name: Create Database
run: |
mkdir -p database
touch database/database.mysql
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "20.x"
cache: "npm"
- name: Install Dependencies & Build
run: |
npm ci
npm run build
- name: 📂 Sync files
uses: SamKirkland/FTP-Deploy-Action@v4.3.5
with:
server: ${{ secrets.ftp_servername }}
username: ${{ secrets.ftp_username }}
password: ${{ secrets.ftp_password }}