ci : split deploy workflow into prod and preprod
All checks were successful
Deploy Production / Deploy to Production (push) Successful in 33s
All checks were successful
Deploy Production / Deploy to Production (push) Successful in 33s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
b5a3dde43b
commit
9aed12e61f
2 changed files with 43 additions and 4 deletions
40
.forgejo/workflows/deploy-prod.yml
Normal file
40
.forgejo/workflows/deploy-prod.yml
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
name: Deploy Production
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
name: Deploy to Production
|
||||
runs-on: docker
|
||||
container:
|
||||
image: forgejo-ci-node:latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
run: |
|
||||
git clone --depth 1 --branch main https://forge.studio-variable.com/${{ github.repository }}.git .
|
||||
|
||||
- name: Build Svelte app
|
||||
run: |
|
||||
npm ci
|
||||
npm run build
|
||||
|
||||
- name: Deploy via FTP
|
||||
env:
|
||||
USERNAME: ${{ secrets.USERNAME }}
|
||||
PASSWORD: ${{ secrets.PASSWORD }}
|
||||
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 $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