Add Forgejo deploy workflow with selective sync
All checks were successful
Deploy / Deploy to pre-production (push) Successful in 7s
All checks were successful
Deploy / Deploy to pre-production (push) Successful in 7s
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>
This commit is contained in:
parent
162cee6dc9
commit
44257321ca
4 changed files with 656 additions and 3 deletions
36
.forgejo/workflows/deploy.yml
Normal file
36
.forgejo/workflows/deploy.yml
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
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
|
||||
Loading…
Add table
Add a link
Reference in a new issue