CI : add deploy config
All checks were successful
Deploy / Deploy to Production (push) Successful in 9s
All checks were successful
Deploy / Deploy to Production (push) Successful in 9s
This commit is contained in:
parent
c04b8d1645
commit
0fd36516f9
1 changed files with 40 additions and 0 deletions
40
.forgejo/workflows/deploy.yml
Normal file
40
.forgejo/workflows/deploy.yml
Normal file
|
|
@ -0,0 +1,40 @@
|
||||||
|
name: Deploy
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
deploy:
|
||||||
|
name: Deploy to Production
|
||||||
|
runs-on: docker
|
||||||
|
container:
|
||||||
|
image: forgejo-ci-php:latest
|
||||||
|
steps:
|
||||||
|
- 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/ 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
|
||||||
Loading…
Add table
Add a link
Reference in a new issue