All checks were successful
Deploy / Deploy to Production (push) Successful in 34s
Move system dependencies installation before checkout step to ensure git is available when needed. Also add curl to dependencies for Composer installation. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
57 lines
1.9 KiB
YAML
57 lines
1.9 KiB
YAML
name: Deploy
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
deploy:
|
|
name: Deploy to Production
|
|
runs-on: docker
|
|
container:
|
|
image: php:8.3-cli
|
|
steps:
|
|
- name: Install system dependencies and PHP extensions
|
|
run: |
|
|
apt-get update && apt-get install -y --no-install-recommends \
|
|
libfreetype6-dev \
|
|
libjpeg62-turbo-dev \
|
|
libpng-dev \
|
|
unzip \
|
|
git \
|
|
curl \
|
|
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
|
|
&& docker-php-ext-install -j$(nproc) gd \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
- name: Install Composer
|
|
run: |
|
|
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
|
|
|
|
- name: Checkout code
|
|
run: |
|
|
git clone --depth 1 --branch main https://forge.studio-variable.com/${{ github.repository }}.git .
|
|
ls -la
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
composer install --no-dev --optimize-autoloader
|
|
|
|
- name: Deploy via FTP
|
|
env:
|
|
USERNAME: ${{ secrets.USERNAME }}
|
|
PASSWORD: ${{ secrets.PASSWORD }}
|
|
PREPRODUCTION_HOST: ${{ secrets.PREPRODUCTION_HOST }}
|
|
run: |
|
|
apt-get update -qq && apt-get install -y -qq lftp
|
|
cat > /tmp/lftp-script.txt <<SCRIPT
|
|
set ftp:ssl-allow no
|
|
open -u $USERNAME,$PASSWORD $PREPRODUCTION_HOST
|
|
mirror --reverse --verbose --ignore-time --parallel=10 -x local/ assets assets
|
|
mirror --reverse --verbose --ignore-time --parallel=10 -x accounts/ -x cache/ -x sessions/ -x header.php site site
|
|
mirror --reverse --verbose --ignore-time --parallel=10 kirby kirby
|
|
mirror --reverse --verbose --ignore-time --parallel=10 vendor vendor
|
|
quit
|
|
SCRIPT
|
|
lftp -f /tmp/lftp-script.txt
|