index-website-static/.forgejo/workflows/deploy.yml
isUnknown 44257321ca
All checks were successful
Deploy / Deploy to pre-production (push) Successful in 7s
Add Forgejo deploy workflow with selective sync
Configure automated deployment via FTP that mirrors all files except hidden ones, with special handling for assets/css to sync only compiled CSS files (style.css and style.css.map).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-18 17:55:51 +01:00

36 lines
1.1 KiB
YAML

name: Deploy
on:
push:
branches:
- main
jobs:
deploy:
name: Deploy to pre-production
runs-on: docker
steps:
- name: Checkout code
run: |
git clone --depth 1 --branch main https://forge.studio-variable.com/${{ github.repository }}.git .
ls -la
- name: Deploy via FTP
env:
USERNAME: ${{ secrets.USERNAME }}
PASSWORD: ${{ secrets.PASSWORD }}
PRODUCTION_HOST: ${{ secrets.PRODUCTION_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 $PRODUCTION_HOST
# Mirror everything except hidden files/folders and assets/css content
mirror --reverse --verbose --ignore-time --parallel=10 -x '.*' -x '*/.*' -x 'assets/css/*' . .
# Sync only style.css and style.css.map from assets/css
cd assets/css
lcd assets/css
mput style.css style.css.map
quit
SCRIPT
lftp -f /tmp/lftp-script.txt