feat: configure CI/CD with Forgejo Actions
Some checks failed
Deploy / Build and Deploy to Production (push) Failing after 26s
Some checks failed
Deploy / Build and Deploy to Production (push) Failing after 26s
- Add Forgejo workflow for automated build and deploy - Build creates dist/ from public/ then adds Vue app build - Configure Vite to build to dist/assets/dist with fixed filenames - Deploy entire dist/ directory to production via FTP - Add workflow documentation with FTP setup instructions The workflow mirrors the GitLab CI approach: dist/ is created during build and synchronized to production root on every push to main. 🤖 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
5fb9cf68a3
commit
052c6958f3
3 changed files with 127 additions and 0 deletions
65
.forgejo/workflows/deploy.yml
Normal file
65
.forgejo/workflows/deploy.yml
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
name: Deploy
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
name: Build and Deploy to 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: Setup Node.js
|
||||
run: |
|
||||
apt-get update -qq && apt-get install -y -qq curl
|
||||
curl -fsSL https://deb.nodesource.com/setup_20.x | bash -
|
||||
apt-get install -y -qq nodejs
|
||||
node --version
|
||||
npm --version
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
npm ci
|
||||
|
||||
- name: Prepare dist directory
|
||||
run: |
|
||||
rm -rf dist
|
||||
cp -r public dist
|
||||
ls -la dist/
|
||||
|
||||
- name: Build Vue app
|
||||
run: |
|
||||
npm run build
|
||||
ls -la dist/assets/dist/
|
||||
|
||||
- name: Deploy via FTP
|
||||
env:
|
||||
USERNAME: ${{ secrets.USERNAME }}
|
||||
PASSWORD: ${{ secrets.PASSWORD }}
|
||||
PRODUCTION_HOST: ${{ secrets.PRODUCTION_HOST }}
|
||||
run: |
|
||||
apt-get install -y -qq lftp
|
||||
cd dist
|
||||
lftp -c "
|
||||
set ftp:ssl-allow no;
|
||||
open -u $USERNAME,$PASSWORD $PRODUCTION_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;
|
||||
put index.php -o index.php;
|
||||
quit"
|
||||
Loading…
Add table
Add a link
Reference in a new issue