This commit is contained in:
parent
c5ae72945d
commit
166d86b351
2 changed files with 50 additions and 0 deletions
46
.forgejo/workflows/deploy.yml
Normal file
46
.forgejo/workflows/deploy.yml
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
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://oauth2:${{ github.token }}@forge.studio-variable.com/${{ github.repository }}.git .
|
||||
|
||||
- name: Install Node.js and build assets
|
||||
run: |
|
||||
curl -fsSL https://deb.nodesource.com/setup_lts.x | bash -
|
||||
apt-get install -y -qq nodejs
|
||||
npm install
|
||||
npx gulp
|
||||
|
||||
- name: Install PHP dependencies
|
||||
run: |
|
||||
composer install --no-dev --optimize-autoloader
|
||||
|
||||
- name: Deploy via FTP
|
||||
env:
|
||||
USERNAME: ${{ secrets.USERNAME }}
|
||||
PASSWORD: ${{ secrets.PASSWORD }}
|
||||
HOST: ${{ secrets.HOST }}
|
||||
run: |
|
||||
apt-get install -y -qq lftp
|
||||
cat > /tmp/lftp-script.txt <<SCRIPT
|
||||
set ftp:ssl-allow no
|
||||
open -u $USERNAME,$PASSWORD $HOST
|
||||
mirror --reverse --verbose --ignore-time --parallel=10 assets/dist assets/dist
|
||||
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
|
||||
4
.gitignore
vendored
4
.gitignore
vendored
|
|
@ -58,3 +58,7 @@ Icon
|
|||
# -----------
|
||||
|
||||
/local
|
||||
|
||||
# Claude settings
|
||||
# -----------
|
||||
.claude
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue